Hello all, I ran across a couple bugs in memdisk concerning hd images the other day. With the attached patch I've been able to successfully boot a 32MB gzipped hd image. (I'll put the image up for a short while at ftp://ftp.io.com/pub/usr/duanev/fdoshd.img.gz) The pxelinux.cfg entry I'm using is: label fdos kernel memdisk append keeppxe initrd=fdoshd.img.gz syslinux/memdisk is great, thanks Peter et. al.! -- Duane Voth duanev at io.com -------------- next part -------------- --- memdisk.asm.orig 2007-08-20 13:02:26.000000000 -0500 +++ memdisk.asm 2007-08-20 17:31:17.000000000 -0500 @@ -462,10 +462,10 @@ cmp dword [es:si+4],-1 je .linear_address - movzx esi,word [es:si+4] ; Offset + movzx ebx,word [es:si+4] ; Offset movzx edi,word [es:si+6] ; Segment shl edi,4 - add esi,edi + add ebx,edi jmp .got_address @@ -476,23 +476,24 @@ cmp dword [es:si+20],0 ; > 4 GB addresses not supported jne .overrun - mov esi,[es:si+16] + mov ebx,[es:si+16] .got_address: cmp dword [es:si+12],0 ; LBA too large? jne .overrun movzx ecx, word [es:si+2] ; Sectors to transfer - mov edi,[es:si+8] ; Starting sector - mov eax,edi + mov esi,[es:si+8] ; Starting sector + mov eax,esi add eax,ecx jc .overrun cmp eax,[DiskSize] ja .overrun shl ecx,SECTORSIZE_LG2-2 ; Convert to dwords - shl edi,SECTORSIZE_LG2 ; Convert to an offset - add edi,[DiskBuf] + shl esi,SECTORSIZE_LG2 ; Convert to an offset + add esi,[DiskBuf] + mov edi,ebx pop es ret
Duane Voth wrote:> Hello all, > > I ran across a couple bugs in memdisk concerning hd images the other > day. With the attached patch I've been able to successfully boot a > 32MB gzipped hd image. (I'll put the image up for a short while at > ftp://ftp.io.com/pub/usr/duanev/fdoshd.img.gz) > > The pxelinux.cfg entry I'm using is: > > label fdos > kernel memdisk > append keeppxe initrd=fdoshd.img.gz > > syslinux/memdisk is great, thanks Peter et. al.! >Thanks!! Staring at it, I feel like a total doofus... I guess that's what happens when one doesn't get the time to work properly. I had to massage your patch to fit into the latest source base; could you please try out 3.52-pre8 to make sure it works as intended? (I have also downloaded your disk image and added it to my collection. It booted, but gave me an "invalid opcode" error after loading DOSLFN -- looks like it might be related to the program "tcpinfo". Not sure if that is expected or not.) -hpa
On Mon, Aug 27, 2007 at 10:38:43PM -0700, H. Peter Anvin wrote:> I had to massage your patch to fit into the latest source base; could > you please try out 3.52-pre8 to make sure it works as intended?Hi Peter, sorry this took so long. I found the repository and tested against Wednesday's top of the tree. The memdisk there runs all my tests just fine.> (I have also downloaded your disk image and added it to my collection. > It booted, but gave me an "invalid opcode" error after loading DOSLFN -- > looks like it might be related to the program "tcpinfo". Not sure if > that is expected or not.)Humm, I don't see tcpinfo in autoexec.bat but maybe you are testing some of the programs on the image by hand. I deliberately left out a packet driver as the undi driver I'm using is proprietary. (undi_pkt.com from www.emboot.com and easily worth the $7 they want) fyi use: # gunzip fdoshd.img.gz # losetup /dev/loop0 -o 32256 fdoshd.img # mount /dev/loop0 /mnt/tmp to hack that filesystem. The image boots (as is) for me inside bochs 2.3, qemu 0.8.2, and on some real hardware, but hangs inside a qemu 0.9.0 via kvm (circa April) but not at doslfn ... it hangs earlier on. duane
Possibly Parallel Threads
- [Bug 1146] New: configure ignores enable-static=yes
- [PATCH] memdisk: Use boot_lba logic for booting an offset within the di
- EFI build problems
- VirtualProtect and app crash: what's your interpretation?
- Where's the optimiser gone (part 11): use the proper instruction for sign extension