Fat 12 Bootsector

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
gmoney
Member
Member
Posts: 106
Joined: Mon Jan 03, 2005 12:00 am
Location: Texas, Usa

Fat 12 Bootsector

Post 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
Just because your phone is "smart" doesn't mean the user is... ijs
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: Fat 12 Bootsector

Post 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)
gmoney
Member
Member
Posts: 106
Joined: Mon Jan 03, 2005 12:00 am
Location: Texas, Usa

Re: Fat 12 Bootsector

Post 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.
Just because your phone is "smart" doesn't mean the user is... ijs
Da_Maestro
Member
Member
Posts: 144
Joined: Tue Oct 26, 2004 11:00 pm
Location: Australia

Re: Fat 12 Bootsector

Post 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
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: Fat 12 Bootsector

Post 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)
rexlunae
Member
Member
Posts: 134
Joined: Sun Oct 24, 2004 11:00 pm
Location: North Dakota, where the buffalo roam

Re: Fat 12 Bootsector

Post 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.
Da_Maestro
Member
Member
Posts: 144
Joined: Tue Oct 26, 2004 11:00 pm
Location: Australia

Re: Fat 12 Bootsector

Post 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.
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
gmoney
Member
Member
Posts: 106
Joined: Mon Jan 03, 2005 12:00 am
Location: Texas, Usa

Re: Fat 12 Bootsector

Post 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.
Just because your phone is "smart" doesn't mean the user is... ijs
gmoney
Member
Member
Posts: 106
Joined: Mon Jan 03, 2005 12:00 am
Location: Texas, Usa

Re: Fat 12 Bootsector

Post by gmoney »

your*
Just because your phone is "smart" doesn't mean the user is... ijs
Da_Maestro
Member
Member
Posts: 144
Joined: Tue Oct 26, 2004 11:00 pm
Location: Australia

Re: Fat 12 Bootsector

Post by Da_Maestro »

gmoney wrote:your*
edit button
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
Post Reply