[patch] doc_stage1.S : GRUB on DoC

Ilguiz Latypov ilatypov at superbt.com
Fri Aug 2 10:02:33 EDT 2002


Mark,

On Fri, 2 Aug 2002, Mark Meade wrote:

> Using GRUBSTART:0 is probably the better way to do this: GRUBSTART:0 is 
> equivalent to GRUBLOADSEG:GRUBLOADOFS (8200:0, 07E0:400), and using zero as 
                                         ^^^^    ^^^^
I believe GRUBSTART is the offset value while GRUBLOADSEG is the segment 
value, i.e. GRUBSTART == (GRUBLOADSEG << 4) + GRUBLOADOFS.  The original 
code was reading a 256 byte flash block into 0x8200:0 which is 532480, and 
this could be either GRUB's playground or interrupt handlers set up by 
BIOS.

> the offset causes the "read block" command to send an address of 0 after
> sending the READID command, similar to the way it's done in
> bdev_diskonchip.c.

I understand that the same register %di serves as the offset to the
destination in RAM and as the offset in flash.  And stage2 or doc2000.c 
code will read chip ID from offset 0.  I think the offset may not be 
important because the READID command tells the chip to report the ID.  

I'd better assign (GRUBLOADSEG << 4) to %es and 0 to %di to stay safe 
though.

Ilguiz





More information about the linux-mtd mailing list