Commit Graph
53 Commits
Author SHA1 Message Date
thomas c26434f814 Some threading code cleanup 2018-03-21 23:12:43 +01:00
thomas 251b5f71c9 Simple scheduler 2018-03-21 23:12:43 +01:00
thomas 1e2f81a5d8 Very simple threading and context switching. 2018-03-21 23:12:43 +01:00
thomas df0df93da7 Don't put multiboot data in page stack 2018-03-20 14:11:22 +01:00
thomas 8711fee390 Interface cleanup 2018-03-20 14:11:22 +01:00
thomas 9a479b1132 Add a PAGE_GLOBAL flag for kernel pages 2018-03-20 14:11:22 +01:00
thomas 470eb5e9f9 Also map non-free memory areas into kernel space 2018-03-20 14:11:22 +01:00
thomas 5dc4e27392 Map all free memory pages and add to page stack 2018-03-20 14:11:22 +01:00
thomas 80cc165957 Read memory map tags from multiboot 2018-03-20 14:11:21 +01:00
thomas 6f0a745adc Ability to bind handler functions to interrupts 2018-03-20 14:11:21 +01:00
thomas 96d2ebd977 Collect the cpu specific stuff 2018-03-20 14:11:21 +01:00
thomas 127d6ca5a4 Interrupt cleanup 2018-03-20 14:11:21 +01:00
thomas cbcc67fc31 Quick and dirty IDT setup 2018-03-20 14:11:21 +01:00
thomas e4e891bb86 Clean up interface 2018-03-20 14:11:21 +01:00
thomas 79ca4681ff Make tests independent of structures in header files 2018-03-20 14:11:21 +01:00
thomas 9dbbc7013c Use debug macros 2018-03-20 14:11:21 +01:00
thomas 497bdef9f4 Debug print some of the multiboot data 2018-03-20 14:11:21 +01:00
thomas 49f7738be2 Parse multiboot information 2018-03-20 14:11:21 +01:00
thomas 9e2483d78e Halt-And-Catch-Fire macro 2018-03-20 14:11:21 +01:00
thomas 042f61bdb3 Add padding to field width (right adjust) 2018-03-20 14:11:21 +01:00
thomas 0659cf73f6 Some more debug macros 2018-03-20 14:11:21 +01:00
thomas 572bee19cc Add ability to disable debug printing and gdb symbols 2018-03-20 14:11:21 +01:00
thomas 4f00d428bf Writing (debug output) to screen 2018-03-20 14:11:21 +01:00
thomas 034a870ac7 Sending data (debug printing) to serial port 2018-03-20 14:11:21 +01:00
thomas d05ddfeab4 Debug printing functions 2018-03-20 14:11:21 +01:00
thomas 8e47d7625f Don't set fs and gs. 2018-03-20 14:10:03 +01:00
thomas 950de8645c Update GDT pointer after unmapping GDT 2018-03-20 14:10:03 +01:00
thomas b5e0d749b8 Reload cr3 after updating P4 2018-03-20 14:10:03 +01:00
thomas 83f81b9a74 Cleaning up and commenting 2018-03-20 14:10:03 +01:00
thomas ab1a471857 Call a c function. 2018-03-20 14:10:03 +01:00
thomas 0a4b5ebd51 Update the stack pointer and remove identity mapping 2018-03-20 14:10:03 +01:00
thomas 663668ff93 Move the kernel to high memory 2018-03-20 14:10:03 +01:00
thomas 646d25825a Don't use huge pages, for simplicity 2018-03-20 14:01:26 +01:00
thomas 99ecff44d8 Save one byte! 2018-03-19 20:29:40 +01:00
thomas 3122de1666 Remove cpuid and longmode checks. Let's assume we have a modern processor 2018-03-19 20:29:40 +01:00
thomas 3d380f462b Use 2 Mb translation instead of 1 Gb 2018-03-19 20:29:40 +01:00
thomas 78dc192a16 Don't load fs and gs. They have special meaning in long mode. 2018-03-19 20:29:40 +01:00
thomas bb25b7ea35 Change comment style, and more commenting 2018-03-19 20:29:40 +01:00
thomas 4f9a4292e5 Some simplification and commenting 2018-03-19 20:29:40 +01:00
thomas 93d60294ba Move include files 2018-03-19 20:29:40 +01:00
thomas 5ddf0173c2 Remove magic numbers. Also, no code segment - not needed. 2018-03-19 20:29:40 +01:00
thomas dd7636e906 Simplest possible long-mode entry 2018-03-19 20:29:40 +01:00
thomas eb637d0bbb Move stack to .bss and use it for function calls as well 2018-03-19 20:29:40 +01:00
thomas dd565454e3 Check if long mode is available 2018-03-19 20:29:40 +01:00
thomas 607266bfd3 Clean up interface 2018-03-19 20:29:40 +01:00
thomas 2451851b9f Remove Multiboot1 support 2018-03-19 20:29:40 +01:00
thomas bc8f16e270 Also simplify the kernel code as much as possible. 2018-03-19 20:29:40 +01:00
thomas ca36e0ad0e Indicate multiboot version on boot 2018-03-19 20:29:40 +01:00
thomas a44d0d7500 Move Multiboot headers to separate file 2018-03-19 20:29:40 +01:00
thomas dda15ea889 Save eax after boot, so we can check that we're actually loaded via
multiboot
2018-03-19 20:29:40 +01:00