OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 23, 2024 8:34 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Finding stage2
PostPosted: Mon Apr 01, 2002 5:00 am 
Hi,

I'm searching for a way to find a 2nd stage of a boot loader - best would be to be fs-independent. Any clues??

Thanks

Darkening


Top
  
 
 Post subject: Re: Finding stage2
PostPosted: Mon Apr 01, 2002 5:15 pm 
If you don't use the filesystem, there are two other ways:

1. Assume the second stage is stored in contiguous sectors
on the disk.  The only information you need to find the
second stage is the starting sector and number of sectors.

A file stored on a freshly-formatted FAT12 or FAT16 disk
will be stored in contiguous sectors, but not if you modify
the file afterwards.

2. Write a program to make a list of the disk sectors
which contain the second stage, then write this sector list
into the first stage code. This is how the LILO and GRUB
first stages work, I think.

If you modify the second stage file, you must re-run the
sector list installer.


Top
  
 
 Post subject: Re: Finding stage2
PostPosted: Mon Apr 01, 2002 6:42 pm 
Thanks for the hints, I also thought about an asm-header with a signature. Now I'm wondering about the 2nd stage - I'd like to use gcc - but it outputs 32bit (with objcopy) and then I can't read from disk (GRUB does this with switching between 16- and 32bit, but it seems a bit complicated), so does anyone know something about this???

Darkening


Top
  
 
 Post subject: Re: Finding stage2
PostPosted: Tue Apr 02, 2002 6:22 pm 
There are at least 4 free C compilers that produce 16-bit
(real mode) code. I've used Watcom C and Turbo C. Both work OK.


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], SemrushBot [Bot] and 118 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group