Additional steps to load fonts on WAM machines:
1- Start XFS xfs -config /afs/wam.umd.edu/home/wam/s/o/sodre/pub/bochs.xfs & 2- Set XFS in the current display xset +fp tcp/you.are.working.machine:7100 3- Rehash it xset fp rehash
The submit program is now installed in ~jh41201/BIN/submit.
Please delete the file hd.img before submitting your program.
Buildfat has been added to the list of files on the project #1 web page. It should be a subdirectory off your main project1 directory.
The project should use only one TSS. When you switch to user mode, just update the one TSS to refer to the appropriate LDT.
When you dispatch a user mode process, you will need to load the ldt selector for that process (via the assembler instruction lldt). You will probably need to add code to lowlevel.asm near the label (.restore) and in the function Restore_Thread to do this.
Likewise the various code/data/stack selectors for that process will get pushed onto the stack so that the iret instruction can finish the context switch.
On context switch to use mode, you will also want to to set the TSS ring0 stack to be a stack for the kernel thread. The easiest thing to do is to set it to be the current kthread's stack plus one page.
There is an issue with the gcc compiler trying to use special inlined versions of string functions. The improved solution is to add the compiler flag -fno-builtin to the CFLAGS variable in the kernel Makefile.
Clarification on setting up the ldt descriptor and ldtSelector. The following bit of code shows the sequence required.
context->ldtDescriptor = Allocate_Segment_Descriptor(); Init_LDT_Descriptor( context->ldtDescriptor, context->ldt, NUM_USER_LDT_ENTRIES ); index = Get_Descriptor_Index(context->ldtDescriptor); context->ldtSelector = Selector( KERNEL_PRIVILEGE, TRUE, index );
Tips on debugging:
Bugs in GeekOS We have located a couple of bugs in GeekOS. You should follow the direction at destroyThread.html to fix a problem in kthead.c and replace pfat.c.
Bug found in strcpy (in string.c). There is a bug in strcpy. It was failing to add a null character to the destination string when it gets copied. The correct version is
char *strcpy(char *dest, const char *src) { char *ret; ret = dest; while (*src) { *dest++ = *src++; } *dest = '\0'; return ret; }
4/19/02 - Bug found in bitset.c, please download a new copy. The call to memset had the paramters in the wrong order.
4/19/02 - The system call function associated with SYS_STAT is Stat(...) not State(...).