Page 1 of 1
how to run test programs
Posted: Wed Feb 28, 2007 6:20 pm
by GLneo
hi all, i have everything setup to run programs but i don't know where to put them, i used to just put it after my kernel in my floppy image (bootsect.bin, kernel.sys, testprog.bin) but my .bss overwrites this program at runtime, any ideas on how to get a program to memory ( my FLOPPY + FAT drivers are not very good yet so i don't trust them )
p.s. i don't use GRUB ( yet ) any help switching to GRUB also welcome...
Posted: Wed Feb 28, 2007 6:31 pm
by Crazed123
If you *want* to switch to GRUB, your kernel just needs to start with a small Multiboot header. The header contains a magic number, some requested features flags, and a bit else. Then you just compile the kernel to a GRUB-supported binary format like ELF, and let GRUB load it. When it does, it will pass your kernel entry-point a magic Multiboot number and a pointer to a structure containing boot information for the kernel.
Since GRUB can also load modules into physical memory for you, I highly recommend it.
Posted: Wed Feb 28, 2007 7:18 pm
by GLneo
what i need to switch is a program i can use in a .bat file ( dos command line ) that can put my "kernel.sys" in a FAT grub image.
Posted: Wed Feb 28, 2007 10:34 pm
by bubach
how much room do you got left in your bootsector? can't you make a small loop that moves the program(s) out of the way?