my kernel + bootprog not working

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
gonchuki

my kernel + bootprog not working

Post by gonchuki »

hi everyone!

I'm new to this stuff of OS development (well, everyone has been a newbie some time :-[) ... and i just got a <<common?>> newbie problem:

As I read a lot of OS dev stuff I realized that making a bootloader is not the best place to start, so i just started an exhaustive search of simple bootloaders... in my opinion, bootprog would be the best one (GRUB does not run COM/EXE binaries) ... well, by using the OS for Dummies i had no problem booting, all went correct and smooth... but i still can't make my simple kernel to load. No error messages, no reboots, the PC just hangs after reading the floppy.
I tried with several things in the start: section of the asm kernel file and no one worked: calling the c_main function, doing a jmp 0xFFFF:0x0000 to force a reboot... nothing works.
Please, can someone guide me on how to boot a simple kernel??? may be i made something wrong in the compiling process???
Tom

Re:my kernel + bootprog not working

Post by Tom »

if you use linux I could help you, do you use Linux to make your OS?
gonchuki

Re:my kernel + bootprog not working

Post by gonchuki »

no, i'm using windows :-[ that's why i don't use GRUB... and i don't know if there's a windows compiler that outputs ELF binaries ??? ??? ??? suggestions? :-\
Schol-R-LEA

Re:my kernel + bootprog not working

Post by Schol-R-LEA »

Actually, it is entirely possible to use GRUB to load Windows, though it does take some work. See sections 4.1.2 and 4.2.6 in the GRUB manual for details of how to do so, if you want to try it. I'd strongly recommend testing it out in Bochs or on a testbed machine first before committing you development workstation to it, though, and verify your backups, too.
Warmaster199

Re:my kernel + bootprog not working

Post by Warmaster199 »

gonchuki wrote: no, i'm using windows :-[ that's why i don't use GRUB... and i don't know if there's a windows compiler that outputs ELF binaries ??? ??? ??? suggestions? :-\
---> Use the (G)nu (C) (C)ompiler (GCC). It's a free compiler downloadable from the net. The DOS port is called DJGPP(There is no windows port that I know of :P). I am pretting sure that all of us hardcore OS developers use DJGPP (GCC[compiler] and LD[linker]). Use NASM for the assembler modules and link with LD.

LD will output ELF binaries... [move]"...as well as any executable format know to man"[/move]
Tim

Re:my kernel + bootprog not working

Post by Tim »

The DOS port is called DJGPP(There is no windows port that I know of ).
The Cygwin package contains Windows ports of gcc and binutils, and is quite widely used.
gonchuki

Re:my kernel + bootprog not working

Post by gonchuki »

Yes! i'm already using this package... directly installed with Dev-Cpp... but i didn't know gcc + ld could make ELF binaries.

So... what parameters do i have to feed them to get the ELF output? i already know that for NASM is "-f elf" but.... what for gcc and ld?
Post Reply