I am still tinkering with my FAT32 bootloader. It works well, but it makes the assumption that when it loads stage 2, it will find it in the first cluster of the root directory. I am trying to remove this assumption, so if the RD is longer than one cluster, it can lookup the FAT, find the next cluster, load it and continue.
I'm having problems reading from the FAT. I am using INT 13, AH 0x42 to read sectors. During startup, I set these values:
Code: Select all
[ORG 0x0000]
MOV AX, 0x07C0
MOV DS, AX
MOV ES, AX
MOV AX, 0x0000
MOV SS, AX
MOV SP, 0xFFFF
DAP is setup like this:
Code: Select all
.Size DB 0x10
.NULL DB 0x00
.Sectors DW 0x01
.Offset DW 0x8E00
.Segment DW 0x00
.LBA DD 0x5F
.LBA48 DD 0x00
The RD cluster is located at the second entry of the FAT, so I think I need to read a DWORD from 07C0:1202. Is this correct, or do I have a misunderstanding?
Thankyou for your help