Modestus Moon OS  R4
CS 450 project
R3

Data Structures

struct  context_t
 processContext_t structure that conatiains the CPU register context_t More...
 

Macros

#define BG_WHITE   "\033[48;2;255;255;255m"
 

Functions

int yield ()
 stops the exection of commhand and executes each process in the ready queue More...
 
int loadr3 (char parameters[][MAX_LENGTH])
 loads all processes into memory in a suspended ready state at any priority of the users choosing More...
 

Detailed Description

This grouping provides a quick access to all development that occured during module R2. Each function or file that was added during this module can be found here.

Macro Definition Documentation

#define BG_WHITE   "\033[48;2;255;255;255m"

Definition at line 23 of file input.h.

Referenced by help().

Function Documentation

int loadr3 ( char  parameters[][MAX_LENGTH])

loads all processes into memory in a suspended ready state at any priority of the users choosing

Parameters
parameterstales no parameters so they are voided

Definition at line 825 of file comm_list.c.

References s_processContext::cs, s_processContext::ds, s_processContext::ebp, s_processContext::eflags, s_processContext::eip, s_processContext::es, s_processContext::esp, s_processContext::fs, s_processContext::gs, memset(), proc1(), proc2(), proc3(), proc4(), proc5(), serial_println(), setupPCB(), and SYSTEM.

Referenced by initCmdArray().

825  {
826  (void)parameters;
827  serial_println("Loading processes.");
828 
829  pcb_t* newPCB = setupPCB("R3-Proc1", SYSTEM, 1);
830  processContext_t * cp = ( processContext_t *)( newPCB->stackTop );
831  memset ( cp , 0, sizeof ( processContext_t ));
832  cp->fs = 0x10 ;
833  cp->gs = 0x10 ;
834  cp->ds = 0x10 ;
835  cp->es = 0x10 ;
836  cp->cs = 0x8 ;
837  cp->ebp = ( u32int )( newPCB->stackBase );
838  cp->esp = ( u32int )( newPCB->stackTop );
839  cp->eip = ( u32int ) &proc1 ;// The function correlating to the process , ie. Proc1
840  cp->eflags = 0x202 ;
841 
842  newPCB = setupPCB("R3-Proc2", SYSTEM, 1);
843  cp = ( processContext_t *)( newPCB->stackTop );
844  memset ( cp , 0, sizeof ( processContext_t ));
845  cp->fs = 0x10 ;
846  cp->gs = 0x10 ;
847  cp->ds = 0x10 ;
848  cp->es = 0x10 ;
849  cp->cs = 0x8 ;
850  cp->ebp = ( u32int )( newPCB->stackBase );
851  cp->esp = ( u32int )( newPCB->stackTop );
852  cp->eip = ( u32int ) &proc2 ;// The function correlating to the process , ie. Proc1
853  cp->eflags = 0x202 ;
854 
855 
856  newPCB = setupPCB("R3-Proc3", SYSTEM, 1);
857  cp = ( processContext_t *)( newPCB->stackTop );
858  memset ( cp , 0, sizeof ( processContext_t ));
859  cp->fs = 0x10 ;
860  cp->gs = 0x10 ;
861  cp->ds = 0x10 ;
862  cp->es = 0x10 ;
863  cp->cs = 0x8 ;
864  cp->ebp = ( u32int )( newPCB->stackBase );
865  cp->esp = ( u32int )( newPCB->stackTop );
866  cp->eip = ( u32int ) &proc3 ;// The function correlating to the process , ie. Proc1
867  cp->eflags = 0x202 ;
868 
869  newPCB = setupPCB("R3-Proc4", SYSTEM, 1);
870  cp = ( processContext_t *)( newPCB->stackTop );
871  memset ( cp , 0, sizeof ( processContext_t ));
872  cp->fs = 0x10 ;
873  cp->gs = 0x10 ;
874  cp->ds = 0x10 ;
875  cp->es = 0x10 ;
876  cp->cs = 0x8 ;
877  cp->ebp = ( u32int )( newPCB->stackBase );
878  cp->esp = ( u32int )( newPCB->stackTop );
879  cp->eip = ( u32int ) &proc4 ;// The function correlating to the process , ie. Proc1
880  cp->eflags = 0x202 ;
881 
882  newPCB = setupPCB("R3-Proc5", SYSTEM, 1);
883  cp = ( processContext_t *)( newPCB->stackTop );
884  memset ( cp , 0, sizeof ( processContext_t ));
885  cp->fs = 0x10 ;
886  cp->gs = 0x10 ;
887  cp->ds = 0x10 ;
888  cp->es = 0x10 ;
889  cp->cs = 0x8 ;
890  cp->ebp = ( u32int )( newPCB->stackBase );
891  cp->esp = ( u32int )( newPCB->stackTop );
892  cp->eip = ( u32int ) &proc5 ;// The function correlating to the process , ie. Proc1
893  cp->eflags = 0x202 ;
894 
895 
896 
897  return 0;
898 }
u32int eflags
Definition: system.h:75
void proc3()
Definition: procsr3.c:42
u32int gs
Definition: system.h:73
void proc2()
Definition: procsr3.c:27
The s_processContext struct defines the context that each process stores .
Definition: system.h:71
void proc4()
Definition: procsr3.c:57
u32int esp
Definition: system.h:74
void proc1()
Definition: procsr3.c:12
void proc5()
Definition: procsr3.c:72
u32int fs
Definition: system.h:73
typedef for pcb_t struct
Definition: pcb.h:54
u32int es
Definition: system.h:73
u32int cs
Definition: system.h:75
int serial_println(const char *msg)
Definition: serial.c:44
u32int ebp
Definition: system.h:74
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 ...
Definition: pcb.c:71
unsigned long u32int
Definition: system.h:27
void * memset(void *s, int c, size_t n)
memset Set a region of memory.
Definition: string.c:139
u32int eip
Definition: system.h:75
u32int ds
Definition: system.h:73
int yield ( )

stops the exection of commhand and executes each process in the ready queue

Parameters
parameterstakes no parameters so they are voided

Definition at line 820 of file comm_list.c.

820  {
821  asm volatile("int $60");
822  return 0;
823 }