238 Commits

Author SHA1 Message Date
josh
f51426f73f fixed memory barrier bug in IDT initialization -- kernel still crashing when interrupts enabled but i think the memory management initialization is correct
git-svn-id: svn://anubis/hos/trunk@102 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-02-01 05:24:40 +00:00
josh
4b688a3ce0 fixed bug that mapping PAGE_DIR_SELF_REF would incorrectly allocate a new physical page
git-svn-id: svn://anubis/hos/trunk@101 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-02-01 05:04:39 +00:00
josh
563758b1bd added PAGE_DIR_SELF_REF2 to fix bug in page directory self-referencing
git-svn-id: svn://anubis/hos/trunk@100 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-02-01 04:21:29 +00:00
josh
ae5dc7df6f in the middle of clearing page tables allocated during mm_map() and mm_early_map()
git-svn-id: svn://anubis/hos/trunk@99 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-02-01 01:47:19 +00:00
josh
d41ffbbedc added mm_early_vpage_alloc(); kernel still crashing...
git-svn-id: svn://anubis/hos/trunk@98 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-28 04:22:02 +00:00
josh
5ac343a2e8 fixed mm bug, now crashing because IDT isn't mapped via paging
git-svn-id: svn://anubis/hos/trunk@97 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-27 05:25:05 +00:00
josh
1027b8c346 compiling again after updating mm_early_map() and mm_map() for new page allocation scheme
git-svn-id: svn://anubis/hos/trunk@96 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-27 05:06:12 +00:00
josh
08491bace9 still reworking physical page allocator
git-svn-id: svn://anubis/hos/trunk@95 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-26 05:25:46 +00:00
josh
96ba9fabb1 reworking memory management... again
git-svn-id: svn://anubis/hos/trunk@94 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-25 23:03:23 +00:00
josh
24485b8143 fixed line endings on text files
git-svn-id: svn://anubis/hos/trunk@93 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-25 16:04:08 +00:00
josh
ca82cc32ac cleaned up a few page allocation page issues, still crashing
git-svn-id: svn://anubis/hos/trunk@92 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-25 15:59:27 +00:00
josh
4816102139 kernel compiling with new page allocation mechanism but crashing
git-svn-id: svn://anubis/hos/trunk@91 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-25 05:56:40 +00:00
josh
0bc304328d kernel now keeping track of total/free number of physical pages instead of free/used
git-svn-id: svn://anubis/hos/trunk@90 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-22 20:51:34 +00:00
josh
dccecb054b fixed BUILD_BUG_ON() to work in C++
git-svn-id: svn://anubis/hos/trunk@89 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-22 20:48:41 +00:00
josh
0c78e21e14 added STACK_INITIAL_SIZE to control the number of initial stack pages; added BUILD_BUG_ON() macro to catch compile-time errors
git-svn-id: svn://anubis/hos/trunk@88 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-22 19:35:43 +00:00
josh
53407d7b59 rearranged slightly
git-svn-id: svn://anubis/hos/trunk@87 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-22 18:19:20 +00:00
josh
cdea1602d5 added bochs target to Makefile
git-svn-id: svn://anubis/hos/trunk@86 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-22 18:19:17 +00:00
josh
b6bebfd9b4 removed debug print
git-svn-id: svn://anubis/hos/trunk@85 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-14 15:54:16 +00:00
josh
1be6e37961 thanks to bug found by Nick - fixed mmap traversal and size calculation
git-svn-id: svn://anubis/hos/trunk@84 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-14 15:43:49 +00:00
josh
85c5a26631 removed erroneous offset by four when calculating address of mmap structure from bootloader
git-svn-id: svn://anubis/hos/trunk@83 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-14 04:23:26 +00:00
josh
eb2dd3b1ad updated start symbol comment
git-svn-id: svn://anubis/hos/trunk@82 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-07 19:14:34 +00:00
josh
6cd78f195f changed kernel stack top to 0x40000000 (1GB) virtual
git-svn-id: svn://anubis/hos/trunk@81 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-07 15:56:53 +00:00
josh
e4701b8d96 merged in removing-assembly branch to do more in C
git-svn-id: svn://anubis/hos/trunk@80 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-07 15:38:15 +00:00
josh
76ac4f88a4 set virtual offset to 0x0, kernel now runs in qemu / VirtualBox
git-svn-id: svn://anubis/hos/trunk@73 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-06 05:37:04 +00:00
josh
f6e71b9891 minor Makefile improvements
git-svn-id: svn://anubis/hos/trunk@72 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-06 05:04:59 +00:00
josh
cf7287d368 removed multiboot kludge; using ELF kernel with different virtual and load addresses
git-svn-id: svn://anubis/hos/trunk@71 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-06 05:02:32 +00:00
josh
44c6bac2af added util folder with build script for i586-elf target cross-compiler
git-svn-id: svn://anubis/hos/trunk@70 5b3e749e-e535-0410-8002-a9bb6afbdfca
2010-01-02 02:10:20 +00:00
josh
bc7064e92a got interrupts working, added sys/{pic,timer,cpu} modules, ready to work on multitasking
git-svn-id: svn://anubis/hos/trunk@69 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-29 22:30:52 +00:00
josh
2c5a5d7093 moved gdtr_t definition from mm.h to hos_types.h
git-svn-id: svn://anubis/hos/trunk@68 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-24 17:05:11 +00:00
josh
ddd8c9fd71 split mm_map() and mm_page_alloc() into regular and "early" versions (mm_early_map() and mm_early_page_alloc()); removed mm_use_virtual_offset flag
git-svn-id: svn://anubis/hos/trunk@67 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-24 14:51:23 +00:00
josh
d7be0159c9 created /kernel/isr subdir, moved isr.asm from boot to isr module, added interrupts.cc for isr() main function and isr_bootstrap() routine
git-svn-id: svn://anubis/hos/trunk@66 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-24 14:19:31 +00:00
josh
d352afd079 added int_stack_t type in hos_types.h for interrupt stack access
git-svn-id: svn://anubis/hos/trunk@65 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-24 14:02:11 +00:00
josh
1105e6e203 optimized isr.asm a bit
git-svn-id: svn://anubis/hos/trunk@64 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-24 13:50:29 +00:00
josh
339eef5976 build process generating assembly list files for .asm sources; ignoring .lst files in /kernel/boot
git-svn-id: svn://anubis/hos/trunk@63 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-23 22:03:57 +00:00
josh
6a75fdfc10 Added isr.asm with 50 isr_%d labels defined, ready to call isr()
git-svn-id: svn://anubis/hos/trunk@62 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-23 22:02:11 +00:00
josh
2f810cc2ec Reduced grub timeout in menu.lst
git-svn-id: svn://anubis/hos/trunk@61 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-22 21:00:18 +00:00
josh
63289deade updated include/portio.h to not use gcc-specific "statement blocks" but instead have inportX() be static inline functions. Verified that the compiler does in fact inline them
git-svn-id: svn://anubis/hos/trunk@60 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-20 19:21:20 +00:00
josh
e70b1a5213 removed special cases for formatting of lowest signed values due to Corrin' rationale; fixed formatting routines to handle formatting "0" values
git-svn-id: svn://anubis/hos/trunk@59 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-20 19:10:54 +00:00
josh
c21caccb1f printing memory map, used pages, and free pages on boot
git-svn-id: svn://anubis/hos/trunk@58 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-16 00:05:44 +00:00
josh
fd02ee26e1 added kputs_pad(); implemented padding in kprintf(); put some padding tests in k_main()
git-svn-id: svn://anubis/hos/trunk@57 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-15 14:53:58 +00:00
josh
ecd74fe35b starting kio change
git-svn-id: svn://anubis/hos/trunk@56 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-15 02:47:46 +00:00
josh
08af04897c added include/portio.h; using it to update cursor position in kputc()
git-svn-id: svn://anubis/hos/trunk@55 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-14 20:37:10 +00:00
josh
1dd8250048 moved call to stack_bootstrap() into mm_bootstrap() since stack_bootstrap() relies on calling mm_map() and mm_use_virtual_offset was getting unset at the end of mm_bootstrap(); calling k_main() now works!
git-svn-id: svn://anubis/hos/trunk@54 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-14 16:08:06 +00:00
josh
118021a0f6 added Makefile commands to build a binary and an ELF kernel and do disassemble the ELF version
git-svn-id: svn://anubis/hos/trunk@53 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-14 13:50:29 +00:00
josh
bf9c7d74eb added mm/stack module; initializing "permanent" stack for kernel use while paging, crashing when calling k_main() though...
git-svn-id: svn://anubis/hos/trunk@52 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-14 13:31:08 +00:00
josh
cf2d28f5ce added k_main.cc, need to set up a stack before calling k_main()
git-svn-id: svn://anubis/hos/trunk@51 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-14 03:34:16 +00:00
josh
594625b0fa changed lgdt instruction to load from linear address instead of physical address for [mm_gdtr]
git-svn-id: svn://anubis/hos/trunk@50 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-14 00:26:40 +00:00
josh
df719b4281 added code to reset segmentation and enable paging; added fmt_xl2a() in kio; added debug prints in k_bootstrap() since kernel is crashing when trying to enable paging
git-svn-id: svn://anubis/hos/trunk@49 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-13 22:58:48 +00:00
josh
0fb590a407 changed kio routines to accept const char *; added MAKE_DESCRIPTOR() macro to mm
git-svn-id: svn://anubis/hos/trunk@48 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-13 22:38:53 +00:00
josh
5b9651299e fixed a few formatting and string bugs, kprintf() working when called during bootstrapping!
git-svn-id: svn://anubis/hos/trunk@47 5b3e749e-e535-0410-8002-a9bb6afbdfca
2009-07-13 21:54:27 +00:00