Home arrow Forums
OSDEV Forums  


<< Start < Previous 1 2 Next > End >>
H4evr
User

Fresh Osdever
Posts: 3
graphgraph
Karma: 0  
Re: Fat - 2005/10/08 07:53 Thanks for answering my question gaf.
My bootloader uses FAT12 but my problem is:
- Bootloader copies all files from floppy to memory.
- Passes control to STARTUP.BIN ( KERNEL )
Now, from the kernel, how can I pass control to another file?

The bootloader I use is "BootProg" Loader v 1.2 by Alexei A. Frounze (c) 2000 that can be downloaded at http://alexfru.chat.ru.

Hope I was clearly enough.

Thanks,
H4evr
  | | The administrator has disabled public write access.
OSDEV
Community
Advertisement
   
gaf
User

Platinum Osdever
Posts: 153
graph
Karma: 10  
Re: Fat - 2005/10/08 09:32 Hello,
I had a look at BootProg and unless I'm totally mistaken it doesn't load all the files on the disk to memory but only one whose name has to be specified using the REN_PROG utility (startup.bin is just the default name). This means that you would first have to extend the bootsector by adding a loop to it to support multiple files.

I only had a peek at the code, but here's how I'd try to solve the problem:[list]Create a table of image load addresses and program names that can be accessed by the loop. This means that you have to replace 'ImageLoadSeg equ 60h' at the top of boot12.asm by a 'ImageLoadSeg? dw 0x??' for each file you want to load and add the files name's at the bottom as 'ProgramName? db "??? BIN"'.[/list][list]The loop has to start after 'Look for a COM/EXE program to be load and run' and ends right before the 'Run' label.[/list][list]Every reference to 'ProgrammName?' or 'ImageLoadSeg?' has to be fixed and the loop must be iterated once for every file that shall be loaded.[/list][list]After loading all the files specified in your table the code will jump to the last one loaded, which of course has to be your kernel. [/list]
In order to jump to one of the images you have to set up segment registers and stack first. I don't know how .COM files exactly store this information but I'm sure that you can find out by having a look at 'RelocateEXE' and 'Run'.

In case that this all seems like too much work or if you don't know assembler well enought, you might consider using GRUB as a bootloader instead..

regards,
gaf
  | | The administrator has disabled public write access.
H4evr
User

Fresh Osdever
Posts: 3
graphgraph
Karma: 0  
Re: Fat - 2005/10/11 15:30 Thanks gaf.
I took a better look at BootProg and indeed it doesn't copy all files to memory.
I'll use GRUB.

Thanks,
H4evr
  | | The administrator has disabled public write access.
<< Start < Previous 1 2 Next > End >>

A WebArticles site. Sponsored by Evoleto. Motorola V525 / Business Directory / Delaware Incorporation / Home Made Bazaar