Definition at line 30 of file kmain.c.
References allocateMemFromHeap(), changeProcessSuspensionState(), cli, COM1, s_processContext::cs, s_processContext::ds, s_processContext::ebp, s_processContext::eflags, s_processContext::eip, s_processContext::es, s_processContext::esp, freeHeapMem(), s_processContext::fs, s_processContext::gs, hlt, IDLE, idle(), init_commhand(), init_gdt(), init_idt(), init_irq(), init_paging(), init_pic(), initHeap(), initPCBQueues(), klogv(), memset(), NOT_SUSPENDED, set_serial_in(), set_serial_out(), setupPCB(), start_up_anim(), sys_req(), sys_set_free(), sys_set_malloc(), and SYSTEM.
38 klogv(
"Starting MPX boot sequence...");
39 klogv(
"Initialized serial I/O on COM1 device...");
72 if ( magic != 0x2BADB002 ){
79 klogv(
"Initializing Global descriptor table...");
82 klogv(
"Initializing Interrupt Descriptor table..");
85 klogv(
"Initializing Programmable interrupt controller");
93 klogv(
"Installing interrupts...");
96 klogv(
"Enabling interrupts.");
100 klogv(
"Initializing virtual memory...");
103 klogv(
"Initializing PCB Memory");
107 klogv(
"Transferring control to commhand...");
123 cp->
ebp = (
u32int )( newPCB->stackBase );
124 cp->
esp = (
u32int )( newPCB->stackTop );
131 cp = ( newPCB->context );
138 cp->
ebp = (
u32int )( newPCB->stackBase );
147 klogv(
"Starting system shutdown procedure...");
150 klogv(
"Shutdown complete. You may now turn off the machine. (QEMU: C-a x)");
void klogv(const char *msg)
int set_serial_out(int device)
void initPCBQueues(void)
initPCBQueues initlize the queues for each process queue. This function calls the list init function ...
The s_processContext struct defines the context that each process stores .
void sys_set_malloc(void *(*func)(size_t))
void initHeap(size_t initialHeapSize)
initHeap initializes the system heap by calling kmalloc with a valid byte size. Creates a CMCB at the...
int set_serial_in(int device)
void sys_set_free(int(*func)(void *))
pcb_t * setupPCB(const char *processName, e_PROCESS_CLASS_t processClass, processPriority_t processPriority)
setupPCB calls allocatePCB, initializes the PCB with the arguments and sets it state to ready ...
e_PCB_ERROR_CODE_t changeProcessSuspensionState(const char *processName, e_PROCESS_SUSPENSION_STATE_t suspensionState)
changeProcessSuspensionState
void init_commhand(void)
init_commhand Starts input loop and waits for shutdown code
void * allocateMemFromHeap(size_t requestedSize)
allocateMemFromHeap takes the requested size and finds the first block that fits. Implements first fi...
void * memset(void *s, int c, size_t n)
memset Set a region of memory.
int freeHeapMem(void *blockAddress)
freeHeapMem takes the block address and frees the memory from the CMCB start to the LMCB end location...