Page 1 of 1

Fat 12 Bootsector

Posted: Mon Apr 24, 2006 11:00 pm
by gmoney
What lsn is the bootsector? ive read many manual and some say 1, and other say 0
Logical Sector 0 Boot Sector
The logical sector l on track T, head H, sector S is located at
0x00 0x02 <a jump instruction to 0x1e>
0x03 0x0a Computer manufacturer?s name ..
when i use this code

Code: Select all

uint8_t *buf = (uint8_t *) 0x1E;
// Read Sector( Device, lsn, buffer);
	ReadSector(FD_DEV0, 0,(uint32_t*)buf);
	strncpy(oem, &buf[0x03], 7);
	printf("floppy = %s \n", oem);
it reads out "o";
and when i use this code

Code: Select all

uint8_t *buf = (uint8_t *) 0x1E;
// Read Sector( Device, lsn, buffer);
	ReadSector(FD_DEV0, 1,(uint32_t*)buf);
	strncpy(oem, &buf[0x03], 7);
	printf("floppy = %s \n", oem);
it reads out "o"
Basically right now im trying to find out the bootsector lsn so i can Print out the manufacturer?s name thanks for your help in advance

Re: Fat 12 Bootsector

Posted: Tue Apr 25, 2006 11:00 pm
by JAAman
lsn? do you mean LBA (logical Block Address)

it would be 0 -- it is the first sector on the partition, and LBA numbers are 0 based so the bootsector is sector 0

however be warned -- CHS is not 0 based, so H=0, C=0, S=1 (not 0)


also note -- the OEM name is often garbage (random characters)

Re: Fat 12 Bootsector

Posted: Tue Apr 25, 2006 11:00 pm
by gmoney
lsn = logical sector number and its the same as lba ,come on now jaaman everybody knows that lol and i used 1 but the manufacture name still didnt come up but thanks anywayz for your help.

Re: Fat 12 Bootsector

Posted: Tue Apr 25, 2006 11:00 pm
by Da_Maestro
Look for the 0x55AA at the end of the sector. This number is the signature that the BIOS looks for when it's booting from the disk

Re: Fat 12 Bootsector

Posted: Wed Apr 26, 2006 11:00 pm
by JAAman
i will try to remember never to help you again, as you dont even read my post!! before replying about how stupid i am

i specifically said it should be lba 0 not lba 1 and you proceed to tell me im stupid, and that you tried 1 and it didnt work

and then i also reminded you that very often the OEM name field (its proper title is OEMname not manufacters name, and is actually the name of the OS which formatted the disk) contains nothing but garbage (random characters)

Re: Fat 12 Bootsector

Posted: Wed Apr 26, 2006 11:00 pm
by rexlunae
gmoney wrote:lsn = logical sector number and its the same as lba ,come on now jaaman everybody knows that
Well, fyi, I havn't heard that tla either. Perhaps I need to gac. But anyway, I know enough not to ipiaqo.

Re: Fat 12 Bootsector

Posted: Wed Apr 26, 2006 11:00 pm
by Da_Maestro
Teach me these other fla's (first letter anacronym) asap.

gmoney, look through the forums for CHS2LBA conversion code. Use it and read block 0.

Re: Fat 12 Bootsector

Posted: Thu Apr 27, 2006 11:00 pm
by gmoney
JAAman i wasn't trying to call you stupid but i thought everybody knew what lsn was and the reason i used 1 and not 0 is because 0 on a floppy is c=16777215, h= 1, s= 128 and 1 is c=0, h=0, s=1 when using lsn to chs converter. im reading some docs on lba so i can implement it into my floppy drive. Thanks everybody for you help and replys.

Re: Fat 12 Bootsector

Posted: Thu Apr 27, 2006 11:00 pm
by gmoney
your*

Re: Fat 12 Bootsector

Posted: Sat Apr 29, 2006 11:00 pm
by Da_Maestro
gmoney wrote:your*
edit button