loading images to run user program?
loading images to run user program?
now I want to have some basic user process, so I will know where are bugs in my OS. because I could not complete my floppy driver and thus no FS support, I need other ideas to load some program emages with the kernel right after the kernel image and my kernel is able to find them. is there any way to do that?
Re:loading images to run user program?
you could physically write the files into separate sectors onto the disk, but that can be very time consuming for that you need to track how many each program takes up (how many sectors). But it is possible.
dd if=/whatever of=/dev/fd0 offset=(number of sectors)
i believe thats the command line for where to write what with DD, but i'd double check.
Hope this somewhat helps
-GT
dd if=/whatever of=/dev/fd0 offset=(number of sectors)
i believe thats the command line for where to write what with DD, but i'd double check.
Hope this somewhat helps
-GT
Re:loading images to run user program?
my floppy driver does not work until now there for I can not read any disk with my kernel. I mean, I want some like ramdisk which will be attached at the end of my kernel - for example after bss section.
Re:loading images to run user program?
If you are using GRUB, it can load extra modules with the kernel. These modules can be the simple user-space programs that you want to load and test. This is what I did anyway, since I don't (yet) have a working floppy driver, either. Take a look at the multiboot specification for info on how to do this.
If you're using someone else's bootloader other than GRUB, check if the bootloader supports loading modules (I know the SIGOPS uBoot loader allows you to load modules, too).
If you've written your own bootloader and it doesn't have this functionality, then I'm afraid that you have little choice...
If you're using someone else's bootloader other than GRUB, check if the bootloader supports loading modules (I know the SIGOPS uBoot loader allows you to load modules, too).
If you've written your own bootloader and it doesn't have this functionality, then I'm afraid that you have little choice...
Re:loading images to run user program?
Note, to use GRUB's module loader to load programs, is that it loads the image as is, it doesnt do any runtime linking.
So for example if you had an elf program loaded as a boot module, it would load it into memory as it appears on disk, complete with elf headers et al.
Note, elf loaders are interesting to write, but not incredibly difficult.
Daryl.
So for example if you had an elf program loaded as a boot module, it would load it into memory as it appears on disk, complete with elf headers et al.
Note, elf loaders are interesting to write, but not incredibly difficult.
Daryl.
Re:loading images to run user program?
That realy what I want now, until my floppy disk driver work. I will write elf loader, to run the programs in the image.