Deleted Added
full compact
16c16
< # $Id: boot1.s,v 1.7 1999/01/10 13:29:51 peter Exp $
---
> # $Id: boot1.s,v 1.8 1999/01/13 23:30:07 rnordier Exp $
42,46c42,54
< xread: pushl %ecx # Set
< pushl %eax # LBA
< pushl %es # Set transfer
< pushl %ebx # buffer
< pushl %edx # Set count:drive
---
> xread: pushl %ss # Address
> popl %ds # data
> xread.1: o16 # Starting
> pushb $0x0 # absolute
> pushl %ecx # block
> pushl %eax # number
> pushl %es # Address of
> pushl %ebx # transfer buffer
> xorl %eax,%eax # Number of
> movb %dh,%al # blocks to
> pushl %eax # transfer
> pushb $0x10 # Size of packet
> movl %esp,%ebp # Packet pointer
48,52c56
< popl %edx # Pop all
< popl %ebx # registers
< popl %es # pushed, but
< popl %ecx # preserve
< popl %ecx # AX
---
> leaw1r(0x10,_bp_,_sp) # Clear stack
130c134
< callwi(xread) # disk
---
> callwi(xread.1) # disk
158c162,165
< read: movl %esp,%ebp # Address stack frame
---
> read: cs_ # LBA support
> tstbim(0x80,MEM_REL+flags-start)# enabled?
> jz read.1 # No
> movwir(0x55aa,_bx) # Magic
159a167,180
> movb $0x41,%ah # BIOS: Check
> int $0x13 # extensions present
> popl %edx # Restore
> jc read.1 # If error
> cmpwir(0xaa55,_bx) # Magic?
> jne read.1 # No
> testb $0x1,%cl # Packet interface?
> jz read.1 # No
> movl %ebp,%esi # Disk packet
> movb $0x42,%ah # BIOS: Extended
> int $0x13 # read
> ret # To caller
>
> read.1: pushl %edx # Save
192c213
< movb1r(0x3,_bp_,_ah) # Blocks to read
---
> movb1r(0x2,_bp_,_ah) # Blocks to read
194c215
< jb read.1 # this
---
> jb read.2 # this
196,197c217,218
< read.1: movwir(0x5,_di) # Try count
< read.2: lesw1r(0x4,_bp_,_bx) # Transfer buffer
---
> read.2: movwir(0x5,_di) # Try count
> read.3: lesw1r(0x4,_bp_,_bx) # Transfer buffer
202c223
< jnc read.3 # If success
---
> jnc read.4 # If success
204c225
< jz read.5 # No
---
> jz read.6 # No
208,209c229,230
< jmp read.2 # Continue
< read.3: movzbl %bl,%eax # Sectors read
---
> jmp read.3 # Continue
> read.4: movzbl %bl,%eax # Sectors read
211c232
< jnc read.4 # LBA,
---
> jnc read.5 # LBA,
213c234
< read.4: shlb %bl # buffer
---
> read.5: shlb %bl # buffer
215,217c236,238
< subbr1(_al,0x3,_bp_) # block count
< ja read # If not done
< read.5: ret # To caller
---
> subbr1(_al,0x2,_bp_) # block count
> ja read.1 # If not done
> read.6: ret # To caller
225a247,248
> flags: .byte FLAGS # Flags
>