Page 1 of 1

Wot's wrong with this!

Posted: Fri May 20, 2005 5:43 am
by Spoon spider
Hi all
Could anybody tell me what is wrong with this boot sector.

;;;OS Boot

org 0x7c00

use16


begin: jmp Start
nop

OEM_ID: db '********'
BytesPerSector: dw 0x0200
SectorsPerCluster: db 0x01
ReservedSectors: dw 0x0001
TotalFATS: db 0x02
MaxRootEntries: dw 0x0e00
TotalSectors: dw 0x0b40
MediaDesciptor: db 0xf0
SectorsPerFAT: dw 0x0009
SectorsPerTrack: dw 0x0012
SidesOnDisk: dw 0x0002
HiddenSectors: dd 0x00000000
TotalSectorsLarge: dd 0x00000000
DriveNumber: db 0x00
Flags: db 0x00
Signature: db 0x29
VolumeID: dd 0xffffffff
VolumeLabel: db '************'
SystemID: db 'FAT12 '

Start:
xor ax,ax
cli
mov ss,ax
mov sp,0x7c00
mov ss,ax
sti
;;;Do some basic checks
;;See if we have an AMD x64
;;;See if we have VBE v3.0
mov ax,0x4f02
mov bx,0x003f
int 0x10
mov si,STitle
call WriteStr
;;;Display graphics card memory
;;;Display useable memory above 1 meg - memory required for the display
Self: jmp Self


WriteChar:
mov ah,0x0e
int 0x10
ret
WriteStr:
mov al,byte[si]
call WriteChar
inc si
cmp byte[si],0x00
je Exit1
jmp WriteStr
Exit1: ret
STitle: db 'Just a test!!',0x00
rb begin+512-2-$
BootSig: dw 0xaa55

Could just be WinXp but when I try to get info from the 'dir' command everything is displayed except that it says there is no
volume label ???

Re:Wot's wrong with this!

Posted: Fri May 20, 2005 5:56 am
by AR
Microsoft in all its wisdom decided to put the volume label in the root directory (There is a type of file called "Volume ID", its name is obviously the volume label), I don't know why they thought that this was a good idea (They never use OEMName or FilSysType either).

Re:Wot's wrong with this!

Posted: Fri May 20, 2005 6:03 am
by Pype.Clicker
the volume label is a special directory entry that should be in the root directory (special flags and stuff). So there's probably nothing wrong with the bootsector itself, but rather with the directory content...

Re:Wot's wrong with this!

Posted: Fri May 20, 2005 7:56 am
by Spoon spider
Thanks everybody :)
The sites I have visited soft of fail to mention this ???