IMG file
IMG file
bochs can make hd img file,
in the img file
the first sector is from 0 to 0x1FF, the second sector is from 0x200 to 0x3FF, the third sector is from 0x400 to 0x5FF,
...... etc.
am i right?
in the img file
the first sector is from 0 to 0x1FF, the second sector is from 0x200 to 0x3FF, the third sector is from 0x400 to 0x5FF,
...... etc.
am i right?
Just For Fun
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: IMG file
Yep.
post++;
post++;
Re: IMG file
Code: Select all
# hard disk
ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata0-master: type=disk, path="c.img", mode=flat, cylinders=20, heads=16, spt=63
I can creat a file, size is 10,321,920 bytes, named 'c.img', then i can make this file as the hd img file to use.
am i right?
Just For Fun
Re: IMG file
another question: bochs can not read/write hd via LBA ?
when i debug the code, bochs told me that:
Code: Select all
; LBA
mov ax, 4200h
mov dl, 80h
mov si, offset cs:dap
push cs
pop ds
int 13h
jmp $
dap: db 10h
db 0
dw 5
dw 0
dw 3000h
dd 0
dd 0
Code: Select all
>>PANIC<< int13_harddisk: function 42. Can't use 64bits lba
Just For Fun
Re: IMG file
Thanks for letting us know. Is there a question?david wrote:when i debug the code, bochs told me that:Code: Select all
>>PANIC<< int13_harddisk: function 42. Can't use 64bits lba
JAL
-
- Posts: 23
- Joined: Tue Nov 11, 2008 3:03 pm
Re: IMG file
bochs works with 28 bit LBA, but not 48 bit, and I didn't even know 64 bit LBA existed :\
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: IMG file
Me neither, and I've been at this for almost a year You learn new things every day.captainwiggles wrote:and I didn't even know 64 bit LBA existed :\
Ooohhhhh, so that's why we have school....
Re: IMG file
Bochs 2.3.7 (perhaps 2.3.5, I'm not sure) works fine with 48-bit LBA. It's in the Changelog for one of the two versions.captainwiggles wrote:bochs works with 28 bit LBA, but not 48 bit, and I didn't even know 64 bit LBA existed :\
-
- Member
- Posts: 524
- Joined: Sun Nov 09, 2008 2:55 am
- Location: Pennsylvania, USA
Re: IMG file
The 64-bit LBA eror is because the upper bits of the LBA address you're sending has something other than 0s in it. Somewhere the LBA address is getting corrupted, either in your DAP or when you generate the address.
Re: IMG file
my error, i forgot the cs's value is 0 when bochs jmps to 0x7c00.
it's ok now.
it's ok now.
Code: Select all
; set CS=07C0, IP=@F
push 07C0h
push @F
retf
@@:
; LBA
mov ax, 4200h
mov dl, 80h
mov si, offset cs:dap
push cs
pop ds
int 13h
dap: db 10h
db 0
dw 5
dw 0
dw 3000h
dd 0
dd 0
Just For Fun
- Troy Martin
- Member
- Posts: 1686
- Joined: Fri Apr 18, 2008 4:40 pm
- Location: Langley, Vancouver, BC, Canada
- Contact:
Re: IMG file
Instead of this:
You should probably do this:
Saves a byte IIRC. And in a bootloader, a byte saved is both a byte earned AND a seriously important thing.
Code: Select all
; set CS=07C0, IP=@F
push 07C0h
push @F
retf
@@:
Code: Select all
; set CS = 07C0h, IP = after this jump
jmp 0x07C0:sync
sync: