Search found 38 matches
- Sat Sep 05, 2009 5:53 pm
- Forum: Beginning OS Development
- Topic: Trying to make my Kernel an Executable
- Replies: 40
- Views: 88720
Re: Trying to make my Kernel an Executable
Still triple faulting
- Sat Sep 05, 2009 5:10 pm
- Forum: Beginning OS Development
- Topic: Trying to make my Kernel an Executable
- Replies: 40
- Views: 88720
Re: Trying to make my Kernel an Executable
So that my function's don't change the previous registers. Also it'd be helpful for debugging purposes.
EDIT:
Adding _declspec(naked) and using iretd didn't help.
EDIT:
Adding _declspec(naked) and using iretd didn't help.
- Fri Sep 04, 2009 6:36 pm
- Forum: Beginning OS Development
- Topic: Trying to make my Kernel an Executable
- Replies: 40
- Views: 88720
Re: Trying to make my Kernel an Executable
Ok, but it'll be a lot of code... //Exception messages char *exception_messages[32] = { "Division by Zero", "Debug", "Non Maskable Interrupt", "Breakpoint", "Info Detected Overflow", "Out of Bounds", "Invalid Opcode", "No Coprocessor", "Double Fault", "Coprocessor Segment Overrun", "Bad TSS", "Segme...
- Thu Sep 03, 2009 5:15 am
- Forum: Beginning OS Development
- Topic: Trying to make my Kernel an Executable
- Replies: 40
- Views: 88720
Re: Trying to make my Kernel an Executable
Oh ok, fixed it. Also, whenever I try generating an interrupt Bochs triple faults?
- Wed Sep 02, 2009 11:18 pm
- Forum: Beginning OS Development
- Topic: Trying to make my Kernel an Executable
- Replies: 40
- Views: 88720
Re: Trying to make my Kernel an Executable
Wouldn't all my problems just be solved if I stuck all the declarations into gdt.h and idt.h and then included them in main.c? EDIT: And they did ... except something's a bit wrong here lol... http://i165.photobucket.com/albums/u49/oib111/kernel2.png For one thing the cursor is at the totally wrong ...
- Wed Sep 02, 2009 8:59 pm
- Forum: Beginning OS Development
- Topic: Trying to make my Kernel an Executable
- Replies: 40
- Views: 88720
Re: Trying to make my Kernel an Executable
Ah...is there anyway to explicitly say what they are or do I have to make some header files?
EDIT:
That didn't do anything...added structure definitions to gdt.h and idt.h but I'm still getting the same errors.
EDIT:
That didn't do anything...added structure definitions to gdt.h and idt.h but I'm still getting the same errors.
- Wed Sep 02, 2009 8:25 pm
- Forum: Beginning OS Development
- Topic: Trying to make my Kernel an Executable
- Replies: 40
- Views: 88720
Re: Trying to make my Kernel an Executable
gdt is an array of structures, and gp is a structure. Here are the definitions of all of them: //in gdt.c // pointer to gdt (needed for lgdt instruction) struct gdt_ptr { unsigned short limit; unsigned int base; }; // define three entries (NULL entry, code descriptor, data descriptor) struct gdt_ent...
- Wed Sep 02, 2009 7:57 pm
- Forum: Beginning OS Development
- Topic: Trying to make my Kernel an Executable
- Replies: 40
- Views: 88720
Re: Trying to make my Kernel an Executable
Huh...moved the definition from common.inc (unsure of why I had it in there in the first place) into bloader2.asm and it works now. That's odd but as long as it works right :)? But back to that other problem of: ------ Build started: Project: Kernel, Configuration: Debug Win32 ------ Compiling... ma...
- Wed Sep 02, 2009 6:44 pm
- Forum: Beginning OS Development
- Topic: Trying to make my Kernel an Executable
- Replies: 40
- Views: 88720
Re: Trying to make my Kernel an Executable
;-------------------------------; ; Validate Kernel is ok ; ;-------------------------------; mov ebx, [IMAGE_PMODE_BASE+60] add ebx, IMAGE_PMODE_BASE ; ebx now points to PE header sig (PE00) mov esi, ebx mov edi, ImageSig cmpsw ; compare the sigs je EXECUTE_KERNEL ; if equal start executing kernel...
- Wed Sep 02, 2009 5:32 pm
- Forum: Beginning OS Development
- Topic: Trying to make my Kernel an Executable
- Replies: 40
- Views: 88720
Re: Trying to make my Kernel an Executable
Ok, removed. Also, wouldn't I have to have interrupts enabled for exceptions to be a problem? EDIT: I started enabling the A20 gate through the output port and now it's working again...well not working. It doesn't triple fault but it still thinks my kernel is corrupt. I tried switching between: mov ...
- Wed Sep 02, 2009 12:01 am
- Forum: Beginning OS Development
- Topic: Trying to make my Kernel an Executable
- Replies: 40
- Views: 88720
Re: Trying to make my Kernel an Executable
No I have /ALIGN:512 set. Hm...I just redid everything (recopied boot1.bin into MBR, reassembled bloader2.asm and copied BOOT2.SYS into E:\, and copied my built kernel into E:\), and I got: Error: OIBKRNL.exe is corrupt. Apparently it's corrupt? I made a PE Validator program and it says it's a valid...
- Tue Sep 01, 2009 8:38 pm
- Forum: Beginning OS Development
- Topic: Trying to make my Kernel an Executable
- Replies: 40
- Views: 88720
Re: Trying to make my Kernel an Executable
What do you mean? Like I didn't disable interrupts and an interrupt occurred so I triple faulted? I don't think it is. I disable interrupts before going into pmode, and I also use the cli instruction in my kernel_entry function just in case. Plus, bochs resets when I try loading the demo's kernel, a...
- Tue Sep 01, 2009 6:29 pm
- Forum: Beginning OS Development
- Topic: Trying to make my Kernel an Executable
- Replies: 40
- Views: 88720
Re: Trying to make my Kernel an Executable
Changing it to gp->base and idtp->base didn't do anything :? Also, I don't know if it's the code in my kernel or if it's Visual Studio, but Bochs always resets when my second stage bootloader hands execution to my kernel (I compiled a version without errors just to test). I thought maybe it was an e...
- Tue Sep 01, 2009 5:54 am
- Forum: Beginning OS Development
- Topic: Trying to make my Kernel an Executable
- Replies: 40
- Views: 88720
Re: Trying to make my Kernel an Executable
Ok cool. I was kind of thinking the whole time, "Then again why I am I use a C++ Runtime when my kernel is all in C and ASM...." Um...just a question. I'm trying to display some info on the GDT and IDT with this code: printf("GDT Installed at: 0x%x\n", gp.base); printf("\t::Code Descriptor Base Addr...
- Mon Aug 31, 2009 11:48 pm
- Forum: Beginning OS Development
- Topic: Trying to make my Kernel an Executable
- Replies: 40
- Views: 88720
Re: Trying to make my Kernel an Executable
Wait, what does main.c have to do with anything? The functions are defined in cstd.cpp in the Lib project, and they're being called from entry.c in the Kernel project? Where does main come into play in all this?