diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/isolinux.asm | 173 | ||||
-rw-r--r-- | core/ui.inc | 7 |
2 files changed, 2 insertions, 178 deletions
diff --git a/core/isolinux.asm b/core/isolinux.asm index ca8ee3a3..7a871f0e 100644 --- a/core/isolinux.asm +++ b/core/isolinux.asm @@ -52,22 +52,6 @@ vk_append: resb max_cmd_len+1 ; Command line vk_end: equ $ ; Should be <= vk_size endstruc -; -; File structure. This holds the information for each currently open file. -; - struc open_file_t -file_sector resd 1 ; Sector pointer (0 = structure free) -file_bytesleft resd 1 ; Number of bytes left -file_left resd 1 ; Number of sectors left - resd 1 ; Unused - endstruc - -%ifndef DEPEND -%if (open_file_t_size & (open_file_t_size-1)) -%error "open_file_t is not a power of 2" -%endif -%endif - ; --------------------------------------------------------------------------- ; BEGIN CODE ; --------------------------------------------------------------------------- @@ -1195,138 +1179,6 @@ ROOT_FS_OPS: ; %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. -; -is_disk_image: - TRACER CR - TRACER LF - TRACER 'D' - TRACER ':' - - mov edx,eax ; File size - mov di,img_table - mov cx,img_table_count - mov eax,[si+file_sector] ; Starting LBA of file - mov [dsp_lba],eax ; Location of file - mov byte [dsp_drive], 0 ; 00h floppy, 80h hard disk -.search_table: - TRACER 't' - mov eax,[di+4] - cmp edx,[di] - je .type_found - add di,8 - loop .search_table - - ; Hard disk image. Need to examine the partition table - ; in order to deduce the C/H/S geometry. Sigh. -.hard_disk_image: - TRACER 'h' - cmp edx,512 - jb .bad_image - - mov bx,trackbuf - mov cx,1 ; Load 1 sector - pm_call getfssec - - cmp word [trackbuf+510],0aa55h ; Boot signature - jne .bad_image ; Image not bootable - - mov cx,4 ; 4 partition entries - mov di,trackbuf+446 ; Start of partition table - - xor ax,ax ; Highest sector(al) head(ah) - -.part_scan: - cmp byte [di+4], 0 - jz .part_loop - lea si,[di+1] - call .hs_check - add si,byte 4 - call .hs_check -.part_loop: - add di,byte 16 - loop .part_scan - - push eax ; H/S - push edx ; File size - mov bl,ah - xor bh,bh - inc bx ; # of heads in BX - xor ah,ah ; # of sectors in AX - cwde ; EAX[31:16] <- 0 - mul bx - shl eax,9 ; Convert to bytes - ; Now eax contains the number of bytes per cylinder - pop ebx ; File size - xor edx,edx - div ebx - and edx,edx - jz .no_remainder - inc eax ; Fractional cylinder... - ; Now (e)ax contains the number of cylinders -.no_remainder: cmp eax,1024 - jna .ok_cyl - mov ax,1024 ; Max possible # -.ok_cyl: dec ax ; Convert to max cylinder no - pop ebx ; S(bl) H(bh) - shl ah,6 - or bl,ah - xchg ax,bx - shl eax,16 - mov ah,bl - mov al,4 ; Hard disk boot - mov byte [dsp_drive], 80h ; Drive 80h = hard disk - -.type_found: - TRACER 'T' - mov bl,[sp_media] - and bl,0F0h ; Copy controller info bits - or al,bl - mov [dsp_media],al ; Emulation type - shr eax,8 - mov [dsp_chs],eax ; C/H/S geometry - mov ax,[sp_devspec] ; Copy device spec - mov [dsp_devspec],ax - mov al,[sp_controller] ; Copy controller index - mov [dsp_controller],al - - TRACER 'V' - call vgaclearmode ; Reset video - - mov ax,4C00h ; Enable emulation and boot - mov si,dspec_packet - mov dl,[DriveNumber] - lss sp,[InitStack] - TRACER 'X' - - call int13 - - ; If this returns, we have problems -.bad_image: - mov si,err_disk_image - call writestr - jmp enter_command - -; -; Look for the highest seen H/S geometry -; We compute cylinders separately -; -.hs_check: - mov bl,[si] ; Head # - cmp bl,ah - jna .done_track - mov ah,bl ; New highest head # -.done_track: mov bl,[si+1] - and bl,3Fh ; Sector # - cmp bl,al - jna .done_sector - mov al,bl -.done_sector: ret - - - ; ----------------------------------------------------------------------------- ; Common modules ; ----------------------------------------------------------------------------- @@ -1352,33 +1204,8 @@ err_disk_image db 'Cannot load disk image (invalid file)?', CR, LF, 0 ; alignz 4 exten_table: db '.cbt' ; COMBOOT (specific) - db '.img' ; Disk image db '.bin' ; CD boot sector db '.com' ; COMBOOT (same as DOS) db '.c32' ; COM32 exten_table_end: dd 0, 0 ; Need 8 null bytes here - -; -; Floppy image table -; - alignz 4 -img_table_count equ 3 -img_table: - dd 1200*1024 ; 1200K floppy - db 1 ; Emulation type - db 80-1 ; Max cylinder - db 15 ; Max sector - db 2-1 ; Max head - - dd 1440*1024 ; 1440K floppy - db 2 ; Emulation type - db 80-1 ; Max cylinder - db 18 ; Max sector - db 2-1 ; Max head - - dd 2880*1024 ; 2880K floppy - db 3 ; Emulation type - db 80-1 ; Max cylinder - db 36 ; Max sector - db 2-1 ; Max head diff --git a/core/ui.inc b/core/ui.inc index 36b6c6ea..f1e046ed 100644 --- a/core/ui.inc +++ b/core/ui.inc @@ -681,11 +681,8 @@ is_bad_image: %else is_bss_sector equ is_bad_image %endif -%if IS_ISOLINUX - ; ok -%else -is_disk_image equ is_bad_image -%endif + +is_disk_image equ is_bad_image ; No longer supported section .data16 boot_prompt db 'boot: ', 0 |