mov byte [CopySuper],superblock_len
%endif
load_bootsec:
- xchg dx,ax
- shl eax,16
- xchg dx,ax ; Now EAX = file length
mov edi, 100000h
mov [trackbuf+4],edi ; Copy from this address
push edi ; Save load address
section .text
is_com32_image:
push si ; Save file handle
- push dx ; File length held in DX:AX
- push ax
+ push eax ; Save file length
call make_plain_cmdline
; Copy the command line into the low cmdline buffer
; do, however, allow the execution of INT 20h to return to SYSLINUX.
;
is_comboot_image:
- and dx,dx
- jnz comboot_too_large
- cmp ax,0ff00h ; Max size in bytes
+ cmp eax,0ff00h ; Max size in bytes
jae comboot_too_large
push si ; Save file handle
pop ds
call searchdir
jz comapi_err
- mov P_AX,ax
- mov P_HAX,dx
+ mov P_EAX,eax
mov P_CX,SECTOR_SIZE
mov P_SI,si
clc
; The kernel image was found, so we can load it...
mov [Kernel_SI],si
- mov [Kernel_EAX],ax
- mov [Kernel_EAX+2],dx
+ mov [Kernel_EAX],eax
; It's not just possible, but quite likely, that ES:BX
; points into real_mode_seg, so we need to exercise some
; If successful:
; ZF clear
; SI = file pointer
-; DX:AX = EAX = file length in bytes
+; EAX = file length in bytes
; ThisInode = the first 128 bytes of the inode
; If unsuccessful
; ZF set
mov [bx+file_left],eax
pop eax
mov si,bx
- mov edx,eax
- shr edx,16 ; 16-bitism, sigh
and eax,eax ; ZF clear unless zero-length file
pop gs
pop cx
;
; loadfont: Load a .psf font file and install it onto the VGA console
; (if we're not on a VGA screen then ignore.) It is called with
-; SI and DX:AX set by routine searchdir
+; SI and EAX set by routine searchdir
;
loadfont:
- mov bx,trackbuf ; The trackbuf is >= 16K; the part
- mov cx,[BufSafe] ; of a PSF file we care about is no
- call getfssec ; more than 8K+4 bytes
+ ; XXX: This can be 8K+4 bytes and the trackbuf is only
+ ; guaranteed to be 8K in size...
+ mov bx,trackbuf
+ mov cx,[BufSafe]
+ call getfssec
mov ax,[trackbuf] ; Magic number
cmp ax,0436h
; open: Input: mangled filename in DS:DI
; Output: ZF set on file not found or zero length
;
-; openfd: Input: file handle in SI
+; openfd: Input: file handle in SI, file size in EAX
; Output: ZF set on getc stack overflow
;
; getc: Output: CF set on end of file
mov [CurrentGetC],bx
mov [bx+gc_file],si ; File pointer
- mov [bx+gc_bytes],ax ; Bytes available
- mov [bx+gc_bytes+2],dx
+ mov [bx+gc_bytes],eax ; Bytes available
xor ax,ax
mov [bx+gc_bufbytes],ax ; Buffer empty
mov [bx+gc_unget_cnt],al ; ungetc buffer empty
%include "ui.inc"
;
-; Enable disk emulation. The kind of disk we emulate is dependent on the size of
-; the file: 1200K, 1440K or 2880K floppy, otherwise harddisk.
+; Enable disk emulation. The kind of disk we emulate is dependent on the
+; size of the file: 1200K, 1440K or 2880K floppy, otherwise harddisk.
;
is_disk_image:
TRACER CR
TRACER 'D'
TRACER ':'
- shl edx,16
- mov dx,ax ; Set EDX <- file size
+ mov edx,eax ; File size
mov di,img_table
mov cx,img_table_count
mov eax,[si+file_sector] ; Starting LBA of file
; If successful:
; ZF clear
; SI = file pointer
-; DX:AX or EAX = file length in bytes
+; EAX = file length in bytes
; If unsuccessful
; ZF set
;
shr eax,SECTOR_SHIFT
mov [bx+file_left],eax
pop eax
- mov edx,eax
- shr edx,16
and bx,bx ; ZF = 0
mov si,bx
pop es
; If successful:
; ZF clear
; SI = file pointer
-; DX:AX or EAX = file length in bytes
+; EAX = file length in bytes
; If unsuccessful
; ZF set
;
jnz .badfile ; If not a file, it's a bad thing
; SI and EAX are already set
- mov edx,eax
- shr edx,16 ; Old 16-bit remnant...
and eax,eax ; EAX != 0
jz .badfile
ret ; Done!
.notfound:
xor eax,eax
- xor dx,dx
ret
section .bss
; If successful:
; ZF clear
; SI = socket pointer
-; DX:AX = file length in bytes
+; EAX = file length in bytes, or -1 if unknown
; If unsuccessful
; ZF set
;
mov eax,[si+tftp_filesize]
cmp eax,-1
jz .no_tsize
- mov edx,eax
- shr edx,16 ; DX:AX == EAX
and eax,eax ; Set ZF depending on file size
pop bp ; Junk
; obsolete.
;
is_linux_kernel:
- and dx,dx
- jnz kernel_sane
- cmp ax,1024 ; Bootsect + 1 setup sect
+ cmp eax,1024 ; Bootsect + 1 setup sect
jb kernel_corrupt
kernel_sane: push ax
push dx
mov di,InitRD
call searchdir ; Look for it in directory
jz .notthere
-
- mov cx,dx
- shl ecx,16
- mov cx,ax ; ECX <- ram disk length
+ mov ecx,eax ; ECX <- ram disk length
mov ax,real_mode_seg
mov es,ax
; COMBOOT function INT 22h, AX=0016h.
mov si,[Kernel_SI]
mov eax,[Kernel_EAX]
- mov dx,[Kernel_EAX+2]
kernel_good:
- pusha
+ pushad
mov si,KernelName
mov di,KernelCName
call unmangle_name
sub di,KernelCName
mov [KernelCNameLen],di
- popa
+ popad
push di
push ax
pop di
;
-; At this point, DX:AX contains the size of the kernel, SI contains
+; At this point, EAX contains the size of the kernel, SI contains
; the file handle/cluster pointer, and ECX contains the extension (if any.)
;
movzx di,byte [KernelType]