| .. | ||
| boot | ||
| cpu | ||
| drivers | ||
| kernel | ||
| libc | ||
| Makefile | ||
| README.md | ||
Concepts you may want to Google beforehand: XX
Goal: Fix miscellaneous issues with our code
The OSDev wiki has a section which describes some issues with JamesM's tutorial. Since we followed his tutorial for lessons 18-22 (interrupts through malloc), we'll need to make sure we fix any of the issues before moving on.
- Wrong CFLAGS
We add -ffreestanding when compiling .o files, which includes kernel_entry.o and thus
kernel.bin and os-image.bin.
Before, we disabled libgcc (not libc) through the use of -nostdlib and we didn't re-enable
it for linking. Since this is tricky, we'll delete -nostdlib
- Not setting a stack
- kernel.c
main()function
Modify kernel/kernel.c and change main() to kernel_main() since gcc recognizes "main" as
a special keyword and we don't want to mess with that.
Change boot/kernel_entry.asm to point to the new name accordingly.
To fix the i386-elf-ld: warning: cannot find entry symbol _start; defaulting to 0000000000001000
warning message, add a global _start; and define the _start: label in boot/kernel_entry.asm.
- Reinvented datatypes
<stddef.h> to provide size_t
- Missing functions
- Interrupt handlers
- also cli, sti in interrupt handlers
- Structs and attributes
- Improperly aligned
kmalloc