Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.os.development    |    Operating system development chatter    |    4,255 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 3,745 of 4,255    |
|    mutazilah@gmail.com to All    |
|    Re: gcc 3.2.3 bug?    |
|    02 Apr 23 14:41:25    |
      From: muta...@gmail.com              Note that the actual problem while running this code       (as opposed to "in this code") is that it doesn't hit the       bits where it says "doesn't get here".              And I have determined that the problem is an incorrect       relocation - bbdd (bbfd in the executable after the 32       bytes of header) is using an offset that goes over the       x'e8' call.              Just by chance, the load point of the executable (x'010700')       converted that x'e8' into x'e9', so I believe I got a jmp instead       of a call.              comp5w.bat in sourceforge will reproduce an equivalent       broken executable - just that call won't be there at all, so       something else gets clobbered.              BFN. Paul.                     C:\devel\pdos\src\xxx2>doit              C:\devel\pdos\src\xxx2>del pdos.exe              C:\devel\pdos\src\xxx2>ld86 -Map map.txt -N -s -e start -o pdos.exe strt32.o       pdos.o os.a pdos.a              C:\devel\pdos\src\xxx2>hexdump pdos.exe 0xbbf0 50       00BBF0 F10FB682 D1100200 0FB69A00 000D21E8 ..............!.       00BC00 F8500000 C1E00809 C30FB682 D2100200 .P..............       00BC10 89D1C1E0 108A92D3 10020009 C389D0C1 ................       00BC20 E018 ..              C:\devel\pdos\src\xxx2>od386 -x pdos.exe | grep bbd       0000bbd4 32 *ABS*       0000bbdd 32 *ABS*                            _fatNuke:        pushl %ebp        movl %esp, %ebp        pushl %edi        pushl %esi        pushl %ebx        subl $28, %esp        movl 12(%ebp), %ebx # second parameter is cluster number, now in ebx        testl %ebx, %ebx        movl 8(%ebp), %edi # first parameter is FAT *, now in edi        movl $0, -16(%ebp)        movl $0, -24(%ebp)        je L663        .p2align 2       L665:        subl $8, %esp        pushl %ebx        pushl %edi        call _fatEndCluster        addl $16, %esp        testl %eax, %eax        jne L689        movl 92(%edi), %eax        cmpl $16, %eax        je L690        cmpl $12, %eax        je L691       L671:        cmpl $32, %eax        jne L665        # fatSector = fat->fatstart + (cluster * 4) / fat->sector_size#        xorl %edx, %edx        leal 0(,%ebx,4), %eax # cluster number in ebx multiplied by 4        movl 16(%edi), %ecx # sector_size is at offset 16 in FAT        divl %ecx # i think edx contains remainder and is ignored, eax contains       extra sectors        movl %eax, %esi        addl 48(%edi), %esi # offset 48 is fatstart, now added to extra sectors,       result in esi        cmpl %esi, -16(%ebp) # stack variable at -16 is "buffered" variable        # if (buffered != fatSector)        je L681 # if we're still doing the same sector number, then jump        movl -16(%ebp), %eax        testl %eax, %eax        jne L692       L682:        pushl %eax        pushl $_buf.8        pushl %esi        pushl %edi        call _fatReadLogical        movl %esi, -16(%ebp)        addl $16, %esp        movl 16(%edi), %ecx       L681:        # gets here        leal 0(,%ebx,4), %eax # cluster number in ebx multiplied by 4, and stored in       eax        xorl %edx, %edx        divl %ecx # repeat the division, and now using the remainder we have the       offset in the sector buffer of interest in edx        movzbl _buf.8+1(%edx), %eax # al has one value        movzbl _buf.8(%edx), %ebx # bl has one value        # gets here        call ___brkpoint        sall $8, %eax        # doesn't get here        orl %eax, %ebx # bx has combination of 2 values        # doesn't get here        movzbl _buf.8+2(%edx), %eax # al has one value        movl %edx, %ecx # copy of the offset for later use        sall $16, %eax # get al into position        # doesn't get here        movb _buf.8+3(%edx), %dl # dl has one value - rest of edx hasn't been zeroed        orl %eax, %ebx # al above is now in right position of ebx        movl %edx, %eax # al has the last (4th) value now (copied from dl)        sall $24, %eax # al into right position        # doesn't get here        orl %eax, %ebx # ebx now complete (cluster number)        # & 0x0fffffff#        andl $-16, %edx # only want high 4 bits of dl        # buf[offset + 3] = buf[offset + 3] & 0xf0#        andl $268435455, %ebx # cluster number now masked with 0f ff ff ff        # cluster number in ebx is now correct and undisturbed for use as       original        # now using ecx as offset        movb $0, _buf.8(%ecx)        # doesn't get here        movb $0, _buf.8+1(%ecx)        movb $0, _buf.8+2(%ecx)        movb %dl, _buf.8+3(%ecx) # those high 4 bits now available for insert        # deletedclusters++#        incl -24(%ebp)        # doesn't get here        jmp L665       L692:              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca