aboutsummaryrefslogtreecommitdiff
path: root/pcb.c
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2015-04-01 20:26:26 -0400
committerBen Burwell <ben@benburwell.com>2015-04-01 20:26:26 -0400
commite282a861d5868868940b449681f2ee5da3e439e8 (patch)
treedc1fb0b3708d717e6c3695fffc77d5df7a0934a8 /pcb.c
parente781fb26fdd422ea72c3a0eeba817e4faa5f663b (diff)
as of 2013-10-292013-10-29
Diffstat (limited to 'pcb.c')
-rw-r--r--pcb.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pcb.c b/pcb.c
index c383a37..9cbaf76 100644
--- a/pcb.c
+++ b/pcb.c
@@ -16,7 +16,7 @@ pcb * search_pcb(pcb * list, char name[]) {
// step through the chain
do {
- if (strcmp(current->name, name) == 0) {
+ if (stricmp(current->name, name) == 0) {
return current;
}
current = current->chain;
@@ -113,6 +113,7 @@ int build_pcb(pcb * addr, char name[], int type, int state,
addr->stack[STK_DS] = ds;
addr->stack_ptr =(unsigned) &(addr->stack[INIT_STACK]);
+ addr->loadaddr = cs;
return 1;
}
@@ -196,7 +197,9 @@ int remove_pcb(pcb **queue, pcb * addr) {
do {
if (current->next == addr) {
current->next = addr->next;
- (current->next)->prev = current;
+ if (current->next != NULL) {
+ (current->next)->prev = current;
+ }
addr->next = NULL;
addr->prev = NULL;
return 0;