Fix user apps randomly crashing (APIC, GDT layout, syscall entry)
All checks were successful
Build documentation / build-and-deploy (push) Successful in 23s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 23s
This commit is contained in:
67
init/init.c
67
init/init.c
@@ -4,25 +4,72 @@
|
||||
#include <stdint.h>
|
||||
#include <string/string.h>
|
||||
|
||||
char c = 'a';
|
||||
|
||||
void app_main (void) {
|
||||
uintptr_t out_paddr;
|
||||
int mem_rid = m_proc_create_resource_mem (16, RV_PRIVATE, &out_paddr);
|
||||
/* uintptr_t out_paddr; */
|
||||
/* int mem_rid = m_proc_create_resource_mem (16, RV_PRIVATE, &out_paddr); */
|
||||
|
||||
m_proc_map (out_paddr, M_PROC_MAP_BASE, 16, PM_PRESENT | PM_RW | PM_USER);
|
||||
/* m_proc_map (out_paddr, M_PROC_MAP_BASE, 16, PM_PRESENT | PM_RW | PM_USER); */
|
||||
|
||||
memset ((void*)M_PROC_MAP_BASE, 0, M_PAGE_SIZE * 16);
|
||||
/* memset ((void*)M_PROC_MAP_BASE, 0, M_PAGE_SIZE * 16); */
|
||||
|
||||
m_proc_unmap (M_PROC_MAP_BASE, 16);
|
||||
/* m_proc_unmap (M_PROC_MAP_BASE, 16); */
|
||||
|
||||
m_proc_drop_resource (mem_rid);
|
||||
/* m_proc_drop_resource (mem_rid); */
|
||||
|
||||
/* m_proc_test (); */
|
||||
|
||||
int mutex_rid = m_proc_create_resource_mutex (RV_PRIVATE);
|
||||
/* int mutex_rid = m_proc_create_resource_mutex (RV_PRIVATE); */
|
||||
|
||||
m_proc_mutex_lock (mutex_rid);
|
||||
/* m_proc_mutex_lock (mutex_rid); */
|
||||
/* m_proc_test (); */
|
||||
m_proc_mutex_unlock (mutex_rid);
|
||||
/* m_proc_mutex_unlock (mutex_rid); */
|
||||
|
||||
/* m_proc_test (); */
|
||||
if (c > 'z')
|
||||
c = 'a';
|
||||
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
m_proc_test (c++);
|
||||
|
||||
__asm__ volatile ("dupa: nop; nop; nop; jmp dupa");
|
||||
/* for (volatile uint64_t i = 0; i < 1000*1000*100; i++); */
|
||||
|
||||
/* if (c > 'z') */
|
||||
/* c = 'a'; */
|
||||
|
||||
/* m_proc_test ('k'); */
|
||||
/* m_proc_test ('l'); */
|
||||
/* m_proc_test ('m'); */
|
||||
/* m_proc_test ('n'); */
|
||||
/* m_proc_test ('o'); */
|
||||
/* m_proc_test ('p'); */
|
||||
/* m_proc_test ('r'); */
|
||||
/* m_proc_test ('s'); */
|
||||
/* m_proc_test ('t'); */
|
||||
/* m_proc_test ('u'); */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user