how to run test programs

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
GLneo
Member
Member
Posts: 237
Joined: Wed Dec 20, 2006 7:56 pm

how to run test programs

Post 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...
Crazed123
Member
Member
Posts: 248
Joined: Thu Oct 21, 2004 11:00 pm

Post 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.
GLneo
Member
Member
Posts: 237
Joined: Wed Dec 20, 2006 7:56 pm

Post 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.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Post 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?
Post Reply