diff -uNr syslinux-3.61/abort.inc syslinux-3.61-new/abort.inc --- syslinux-3.61/abort.inc 2008-02-04 07:58:48 +0300 +++ syslinux-3.61-new/abort.inc 2008-02-13 21:58:16 +0300 @@ -21,6 +21,11 @@ ; abort_check: let the user abort with or ; abort_check: +%ifdef WITH_GFX + ; don't + cmp byte [gfx_ok],0 + jnz .ret1 +%endif call pollchar jz .ret1 pusha diff -uNr syslinux-3.61/add_crc syslinux-3.61-new/add_crc --- syslinux-3.61/add_crc 1970-01-01 03:00:00 +0300 +++ syslinux-3.61-new/add_crc 2008-02-13 21:58:16 +0300 @@ -0,0 +1,57 @@ +#! /usr/bin/perl + +use integer; + +# for isolinux +# +# Ensure checksum over (first sector - 64 bytes) [internally: FirstSecSum] +# is 0 by adjusting the variable csum_value. +# +# Though isolinux checks the integrity with a separate checksum after all +# data has been loaded this does not help with BIOSes that don't get even +# the first 2k right. Hence this additional check. :-( +# + +$file = shift; +$list = "$file"; +$list =~ s/\.bin$/.lst/; + +open F, $list; + +while() { + if(/^\s*\d+\s*(\S+)\s*0+\s*(\<\d+\>\s*)?csum_value\s*dd\s*0/) { + $ofs = hex $1; + } +} +close F; + +die "oops 1\n" unless $ofs && !($ofs & 3); + +# print "$ofs\n"; + +open F, $file or die "$file: $!\n"; + +$file_size = -s $file; + +sysread F, $buf, $file_size; + +close F; + +die "oops 1\n" if $file_size != length($buf); + +@x = unpack "V512", $buf; + +for ($sum = 0, $i = 16; $i < 512; $i++) { + $sum += $x[$i]; +} + +# printf "0x%08x\n", $sum; + +$ns = pack "V", -$sum; + +substr($buf, $ofs, 4) = $ns; + +open F, ">$file" or die "$file: $!\n"; + +syswrite F, $buf; + Файлы syslinux-3.61/com32/lib/libcom32.a и syslinux-3.61-new/com32/lib/libcom32.a различаются diff -uNr syslinux-3.61/com32/libutil/get_key.c syslinux-3.61-new/com32/libutil/get_key.c --- syslinux-3.61/com32/libutil/get_key.c 2008-02-04 07:58:49 +0300 +++ syslinux-3.61-new/com32/libutil/get_key.c 2008-02-13 21:58:16 +0300 @@ -42,6 +42,10 @@ #include #include +#ifndef CLK_TCK +# define CLK_TCK __sysconf(2) +#endif + struct keycode { int code; int seqlen; Файлы syslinux-3.61/com32/libutil/libutil_com.a и syslinux-3.61-new/com32/libutil/libutil_com.a различаются Файлы syslinux-3.61/com32/libutil/libutil_lnx.a и syslinux-3.61-new/com32/libutil/libutil_lnx.a различаются Файлы syslinux-3.61/com32/modules/chain.c32 и syslinux-3.61-new/com32/modules/chain.c32 различаются diff -uNr syslinux-3.61/com32/modules/cpuid.c syslinux-3.61-new/com32/modules/cpuid.c --- syslinux-3.61/com32/modules/cpuid.c 2008-02-04 07:58:49 +0300 +++ syslinux-3.61-new/com32/modules/cpuid.c 2008-02-13 21:58:16 +0300 @@ -238,7 +238,7 @@ static int smp_scan_config (unsigned long base, unsigned long length) { - unsigned long *bp = base; + unsigned long *bp = (unsigned long *) base; struct intel_mp_floating *mpf; // printf("Scan SMP from %p for %ld bytes.\n", bp,length); Файлы syslinux-3.61/com32/modules/cpuidtest.c32 и syslinux-3.61-new/com32/modules/cpuidtest.c32 различаются Файлы syslinux-3.61/com32/modules/dmitest.c32 и syslinux-3.61-new/com32/modules/dmitest.c32 различаются Файлы syslinux-3.61/com32/modules/elf.c32 и syslinux-3.61-new/com32/modules/elf.c32 различаются Файлы syslinux-3.61/com32/modules/ethersel.c32 и syslinux-3.61-new/com32/modules/ethersel.c32 различаются Файлы syslinux-3.61/com32/modules/linux.c32 и syslinux-3.61-new/com32/modules/linux.c32 различаются Файлы syslinux-3.61/com32/modules/mboot.c32 и syslinux-3.61-new/com32/modules/mboot.c32 различаются Файлы syslinux-3.61/com32/modules/meminfo.c32 и syslinux-3.61-new/com32/modules/meminfo.c32 различаются Файлы syslinux-3.61/com32/modules/menu.c32 и syslinux-3.61-new/com32/modules/menu.c32 различаются Файлы syslinux-3.61/com32/modules/pcitest.c32 и syslinux-3.61-new/com32/modules/pcitest.c32 различаются Файлы syslinux-3.61/com32/modules/pmload.c32 и syslinux-3.61-new/com32/modules/pmload.c32 различаются Файлы syslinux-3.61/com32/modules/reboot.c32 и syslinux-3.61-new/com32/modules/reboot.c32 различаются Файлы syslinux-3.61/com32/modules/vesamenu.c32 и syslinux-3.61-new/com32/modules/vesamenu.c32 различаются Файлы syslinux-3.61/com32/samples/advdump.c32 и syslinux-3.61-new/com32/samples/advdump.c32 различаются Файлы syslinux-3.61/com32/samples/cat.c32 и syslinux-3.61-new/com32/samples/cat.c32 различаются Файлы syslinux-3.61/com32/samples/fancyhello.c32 и syslinux-3.61-new/com32/samples/fancyhello.c32 различаются Файлы syslinux-3.61/com32/samples/fancyhello.lnx и syslinux-3.61-new/com32/samples/fancyhello.lnx различаются Файлы syslinux-3.61/com32/samples/hello.c32 и syslinux-3.61-new/com32/samples/hello.c32 различаются diff -uNr syslinux-3.61/com32/samples/keytest.c syslinux-3.61-new/com32/samples/keytest.c --- syslinux-3.61/com32/samples/keytest.c 2008-02-04 07:58:50 +0300 +++ syslinux-3.61-new/com32/samples/keytest.c 2008-02-13 21:58:16 +0300 @@ -25,6 +25,10 @@ #include /* Provided by libutil */ #include +#ifndef CLK_TCK +# define CLK_TCK __sysconf(2) +#endif + static void cooked_keys(void) { int key; Файлы syslinux-3.61/com32/samples/keytest.c32 и syslinux-3.61-new/com32/samples/keytest.c32 различаются Файлы syslinux-3.61/com32/samples/keytest.lnx и syslinux-3.61-new/com32/samples/keytest.lnx различаются Файлы syslinux-3.61/com32/samples/localboot.c32 и syslinux-3.61-new/com32/samples/localboot.c32 различаются Файлы syslinux-3.61/com32/samples/resolv.c32 и syslinux-3.61-new/com32/samples/resolv.c32 различаются Файлы syslinux-3.61/com32/samples/serialinfo.c32 и syslinux-3.61-new/com32/samples/serialinfo.c32 различаются Файлы syslinux-3.61/com32/samples/vesainfo.c32 и syslinux-3.61-new/com32/samples/vesainfo.c32 различаются diff -uNr syslinux-3.61/conio.inc syslinux-3.61-new/conio.inc --- syslinux-3.61/conio.inc 2008-02-04 07:58:50 +0300 +++ syslinux-3.61-new/conio.inc 2008-02-13 21:58:16 +0300 @@ -47,6 +47,13 @@ ; set by routine searchdir ; get_msg_file: +%ifdef WITH_GFX + ; don't load if graphics code is active + cmp byte [gfx_ok],0 + jz .nogfx + ret +.nogfx: +%endif push es shl edx,16 ; EDX <- DX:AX (length of file) mov dx,ax Файлы syslinux-3.61/copybs.com и syslinux-3.61-new/copybs.com различаются diff -uNr syslinux-3.61/.depend syslinux-3.61-new/.depend --- syslinux-3.61/.depend 1970-01-01 03:00:00 +0300 +++ syslinux-3.61-new/.depend 2008-02-13 21:58:16 +0300 @@ -0,0 +1,37 @@ +gethostip.o: gethostip.c +copybs.bin: copybs.asm +extlinux.bin: extlinux.asm head.inc macros.inc config.inc kernel.inc bios.inc \ + tracers.inc layout.inc stack.inc ext2_fs.inc init.inc cpuinit.inc \ + ui.inc runkernel.inc comboot.inc com32.inc cmdline.inc \ + bootsect.inc abort.inc cleanup.inc getc.inc conio.inc plaincon.inc \ + writestr.inc configinit.inc parseconfig.inc rllpack.inc parsecmd.inc \ + bcopy32.inc loadhigh.inc font.inc graphics.inc highmem.inc strcpy.inc \ + strecpy.inc cache.inc adv.inc keywords.inc +isolinux-debug.bin: isolinux-debug.asm isolinux.asm head.inc macros.inc config.inc kernel.inc \ + bios.inc tracers.inc layout.inc stack.inc writestr.inc writehex.inc \ + init.inc cpuinit.inc ui.inc runkernel.inc comboot.inc com32.inc \ + cmdline.inc bootsect.inc abort.inc cleanup.inc getc.inc conio.inc \ + configinit.inc parseconfig.inc rllpack.inc parsecmd.inc bcopy32.inc \ + loadhigh.inc font.inc graphics.inc highmem.inc strcpy.inc rawcon.inc \ + adv.inc gfxboot.inc keywords.inc +isolinux.bin: isolinux.asm head.inc macros.inc config.inc kernel.inc bios.inc \ + tracers.inc layout.inc stack.inc writestr.inc writehex.inc init.inc \ + cpuinit.inc ui.inc runkernel.inc comboot.inc com32.inc cmdline.inc \ + bootsect.inc abort.inc cleanup.inc getc.inc conio.inc configinit.inc \ + parseconfig.inc rllpack.inc parsecmd.inc bcopy32.inc loadhigh.inc font.inc \ + graphics.inc highmem.inc strcpy.inc rawcon.inc adv.inc gfxboot.inc \ + keywords.inc +ldlinux.bin: ldlinux.asm head.inc macros.inc config.inc kernel.inc bios.inc \ + tracers.inc layout.inc stack.inc cpuinit.inc init.inc ui.inc \ + runkernel.inc comboot.inc com32.inc cmdline.inc bootsect.inc abort.inc \ + cleanup.inc getc.inc conio.inc plaincon.inc writestr.inc configinit.inc \ + parseconfig.inc rllpack.inc parsecmd.inc bcopy32.inc loadhigh.inc font.inc \ + graphics.inc highmem.inc strcpy.inc cache.inc adv.inc gfxboot.inc \ + keywords.inc +pxelinux.bin: pxelinux.asm head.inc macros.inc config.inc kernel.inc bios.inc \ + tracers.inc layout.inc stack.inc pxe.inc init.inc cpuinit.inc ui.inc \ + runkernel.inc comboot.inc com32.inc cmdline.inc bootsect.inc abort.inc \ + cleanup.inc getc.inc conio.inc writestr.inc writehex.inc configinit.inc \ + parseconfig.inc rllpack.inc parsecmd.inc bcopy32.inc loadhigh.inc font.inc \ + graphics.inc highmem.inc strcpy.inc rawcon.inc dnsresolv.inc adv.inc \ + keywords.inc Файлы syslinux-3.61/extlinux/extlinux и syslinux-3.61-new/extlinux/extlinux различаются Файлы syslinux-3.61/gethostip и syslinux-3.61-new/gethostip различаются diff -uNr syslinux-3.61/gfxboot.inc syslinux-3.61-new/gfxboot.inc --- syslinux-3.61/gfxboot.inc 1970-01-01 03:00:00 +0300 +++ syslinux-3.61-new/gfxboot.inc 2008-02-13 21:58:16 +0300 @@ -0,0 +1,1369 @@ + section .text + +load_gfx_msg db 'Loading...', 0 +no_msg db 0 + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; do a reboot +; +do_reboot: + call gfx_done + mov word [472h],1234h + push word 0ffffh + push word 0 + retf + int 19h + jmp $ + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +; wait for 'enter' key pressed +; +wait_for_key: + pusha +wait_for_key_10: + mov ah,0 + int 16h + cmp al,13 + jnz wait_for_key_10 + popa + ret + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; read gfx data +get_gfx_file: + push si + mov si,load_gfx_msg + call cwritestr + pop si + mov word [gfx_mem_start_seg],first_free_seg + push ds + push 40h + pop ds + mov bx,[13h] ; mem size in kb + pop ds + shl bx,6 + mov word [gfx_mem_end_seg],bx + + call gfx_init ; Load and display file + cmp byte [gfx_ok],0 + jz .done + mov si,crlf_msg + call cwritestr +.done: + ret + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; read from disk, ask for disk change, if necessary + +; EAX - Linear sector number +; ES:BX - Target buffer +; BP - Sector count +; +; (es:)bx gets updated + +%if IS_SYSLINUX + +; %define DEBUG_XXX + +getlinsec3: +%ifdef DEBUG_XXX + mov si,txt0 + call dump_params + call crlf +%endif + mov cx,[DiskSize] + or cx,cx + jz getlinsec3_70 ; unlimited + + xor dx,dx + div cx + xchg ax,dx + movzx eax,ax + + mov si,ax + add si,bp + sub si,cx + jbe getlinsec3_40 + ; split + + sub bp,si + movzx ebp,bp + push ebp + push eax + push si + push dx + call getlinsec3_40 + pop dx + pop bp + pop eax + pop esi + add eax,esi + movzx ebp,bp + inc dl + +getlinsec3_40: + push es + pushad + call disk_change + popad + pop es + jc kaboom +getlinsec3_70: +%ifdef DEBUG_XXX + mov si,txt1 + call dump_params + mov si,txt3 + call cwritestr + push ax + mov al,[CurrentDisk] + call writehex2 + pop ax + call crlf + pushad + call getchar + popad +%endif + xor edx,edx + call getlinsec.jmp + ret + +%ifdef DEBUG_XXX +dump_params: + push eax + call cwritestr + mov ax,es + call writehex4 + mov si,txt2 + call cwritestr + mov ax,bx + call writehex4 + mov si,txt3 + call cwritestr + pop eax + push eax + call writehex8 + mov si,txt3 + call cwritestr + mov ax,bp + call writehex4 + pop eax + ret + +txt0 db 'linsec3: ', 0 +txt1 db 'linsec: ', 0 +txt2 db ':', 0 +txt3 db ', ', 0 + +%include "writehex.inc" + +%endif + + +; dl: new disk +; return: CF = 1 -> error +disk_change: + cmp dl,[CurrentDisk] + jz disk_change_90 + + mov [CurrentDisk],dl + movzx eax,dl + mov [gfx_user_info_0],eax + add dl,'1' + mov [boot_disk_msg0],dl + mov [boot_ndisk_msg0],dl + +disk_change_20: + cmp byte [gfx_ok],0 + jz disk_change_40 + mov al,3 + xor di,di + xor si,si + call gfx_infobox + + jmp disk_change_50 +disk_change_40: + mov si,clrln_msg + call cwritestr + mov si,boot_disk_msg + call cwritestr + call wait_for_key + mov si,clrln_msg + call cwritestr +disk_change_50: + xor eax,eax + mov bp,1 + push bx + xor edx,edx + call getlinsec.jmp + pop bx + mov eax,[es:bx+27h] + sub eax,[bsVolumeID] + movzx edx,byte [CurrentDisk] + cmp eax,edx + jz disk_change_90 + mov [gfx_user_info_1],eax + + cmp byte [gfx_ok],0 + jz disk_change_70 + mov al,4 + xor di,di + xor si,si + call gfx_infobox + + jmp disk_change_50 +disk_change_70: + mov si,clrln_msg + call cwritestr + mov si,boot_ndisk_msg + call cwritestr +; mov eax,[es:bx+27h] +; call writehex8 + call wait_for_key + mov si,clrln_msg + call cwritestr + + jmp disk_change_20 +disk_change_90: + ret + + +bsVolumeID equ bsHugeSectors+7 + +boot_disk_msg db 'Please insert boot disk ' +boot_disk_msg0 db '0; then press ENTER to continue.', 0 +boot_ndisk_msg db 'This is not boot disk ' +boot_ndisk_msg0 db '0. Press ENTER to continue.', 0 + +DiskSize dw 0 ; unlimited +CurrentDisk db 0 ; current disk + +clrln_msg db 0dh, ' ', 0dh, 0 + + +cache_metadata: + cmp word [DiskSize],0 + jz cache_md_90 + + mov eax,[FAT] + mov ecx,[bxFATsecs] +cache_md_20: + push eax + push cx + call getcachesector + pop cx + pop eax + inc eax + loop cache_md_20 + + mov eax,[RootDir] +cache_md_40: + push eax + call getcachesector + pop eax + call nextsector + jnc cache_md_40 + +cache_md_90: + ret + + +%endif + + + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +; gfx stuff +; +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +gfx_menu_seg equ real_mode_seg + +; != 0 -> graphics active +gfx_ok db 0 +gfx_cwritestr_old db 0c3h ; 'ret' +gfx_cpio_swab db 0 +gfx_cd_changed db 0 + +gfx_mem_start_seg dw 0 +gfx_mem_end_seg dw 0 + + align 4, db 0 +; the memory area we are working with +gfx_mem dd 0 ; linear address + +gfx_save_area1 dd 0 ; 64k +gfx_save_area1_used db 0 ; != 0 if area1 is in use + +; interface to loadable gfx extension (seg:ofs values) +gfx_bc_jt dd 0 + +gfx_bc_init dd 0 +gfx_bc_done dd 0 +gfx_bc_input dd 0 +gfx_bc_menu_init dd 0 +gfx_bc_infobox_init dd 0 +gfx_bc_infobox_done dd 0 +gfx_bc_progress_init dd 0 +gfx_bc_progress_done dd 0 +gfx_bc_progress_update dd 0 +gfx_bc_progress_limit dd 0 +gfx_bc_password_init dd 0 +gfx_bc_password_done dd 0 + +; menu entry descriptor +menu_entries equ 0 +menu_default equ 2 ; seg:ofs +menu_ent_list equ 6 ; seg:ofs +menu_ent_size equ 10 +menu_arg_list equ 12 ; seg:ofs +menu_arg_size equ 16 +sizeof_menu_desc equ 18 + +menu_desc zb sizeof_menu_desc + +; system config data (52 bytes) +gfx_sysconfig equ $ +gfx_bootloader db 1 ; 0: boot loader type (0: lilo, 1: syslinux, 2: grub) +gfx_sector_shift db SECTOR_SHIFT ; 1: sector shift +gfx_media_type db 0 ; 2: media type (0: disk, 1: floppy, 2: cdrom) +gfx_failsafe db 0 ; 3: turn on failsafe mode (bitmask) + ; 0: SHIFT pressed + ; 1: skip gfxboot + ; 2: skip monitor detection +gfx_sysconfig_size db gfx_sysconfig_end-gfx_sysconfig ; 4: size of sysconfig data +gfx_boot_drive db 0 ; 5: BIOS boot drive +gfx_callback dw gfx_cb ; 6: offset to callback handler +gfx_bootloader_seg dw 0 ; 8: code/data segment used by bootloader; must follow gfx_callback +gfx_reserved_1 dw 0 ; 10 +gfx_user_info_0 dd 0 ; 12: data for info box +gfx_user_info_1 dd 0 ; 16: data for info box +gfx_bios_mem_size dd 0 ; 20: BIOS memory size (in bytes) +gfx_xmem_0 dw 0 ; 24: extended mem area 0 (start:size in MB; 12:4 bits) +gfx_xmem_1 dw 0 ; 26: extended mem area 1 +gfx_xmem_2 dw 0 ; 28: extended mem area 2 +gfx_xmem_3 dw 0 ; 20: extended mem area 3 +gfx_file dd 0 ; 32: start of gfx file +gfx_archive_start dd 0 ; 36: start of cpio archive +gfx_archive_end dd 0 ; 40: end of cpio archive +gfx_mem0_start dd 0 ; 44: low free memory start +gfx_mem0_end dd 0 ; 48: low free memory end +gfx_sysconfig_end equ $ + +gfx_slash db '/', 0 + +%macro lin2segofs 3 + push %1 + call gfx_l2so + pop %3 + pop %2 +%endmacro + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; must not change registers! +; +gfx_get_sysconfig: + push ax +%if IS_ISOLINUX + mov al,[DriveNo] +%else + mov al,[DriveNumber] +%endif + mov [gfx_boot_drive],al + +%if IS_ISOLINUX + mov ah,2 +%else + mov ah,0 +%endif + cmp al,80h ; floppy ? + jae gfx_get_sysconfig_20 + mov ah,1 +gfx_get_sysconfig_20: + + mov [gfx_media_type],ah + + mov [gfx_bootloader_seg],cs + + pop ax + ret + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +; Initialize graphics code. Load and display graphics data. +; +; dx:ax file length +; si start cluster +; +; return: [gfx_ok] = 0/1 +; +gfx_init: + push es + + test byte [KbdFlags],3 + jz gfx_init_10 + mov byte [gfx_failsafe],1 + call ask_user +gfx_init_10: + + test byte [gfx_failsafe],2 + jnz gfx_init_80 + + call highmemsize + + ; setup extended memory areas + pusha + mov eax,[HighMemSize] + mov [gfx_bios_mem_size],eax + shr eax,20 + cmp ax,16 + jb gfx_init_40 ; at least 16MB + mov word [gfx_xmem_0],81h ; 1MB at 8MB + mov word [gfx_xmem_1],0a1h ; 1MB at 10MB + + mov dword [gfx_save_area1],7f0000h ; 8MB-64k +gfx_init_40: + popa + + cld + + movzx ebx,word [gfx_mem_start_seg] + shl ebx,4 + jz gfx_init_80 + + movzx ecx,word [gfx_mem_end_seg] + shl ecx,4 + jz gfx_init_80 + + cmp ecx,ebx + jbe gfx_init_80 + + ; define our memory area + ; gfx_mem _must_ be 16-byte aligned + mov dword [gfx_mem],ebx + mov dword [gfx_mem0_start],ebx + mov dword [gfx_mem0_end],ecx + + call gfx_read_file + cmp byte [gfx_ok],0 + jz near gfx_init_90 + + call gfx_get_sysconfig + + ; align 4 + mov eax,[gfx_mem0_start] + add eax,3 + and eax,~3 + mov [gfx_mem0_start],eax + + ; setup jump table + les bx,[gfx_bc_jt] + + mov ax,[es:bx] + mov [gfx_bc_init],ax + mov [gfx_bc_init+2],es + + mov ax,[es:bx+2] + mov [gfx_bc_done],ax + mov [gfx_bc_done+2],es + + mov ax,[es:bx+4] + mov [gfx_bc_input],ax + mov [gfx_bc_input+2],es + + mov ax,[es:bx+6] + mov [gfx_bc_menu_init],ax + mov [gfx_bc_menu_init+2],es + + mov ax,[es:bx+8] + mov [gfx_bc_infobox_init],ax + mov [gfx_bc_infobox_init+2],es + + mov ax,[es:bx+10] + mov [gfx_bc_infobox_done],ax + mov [gfx_bc_infobox_done+2],es + + mov ax,[es:bx+12] + mov [gfx_bc_progress_init],ax + mov [gfx_bc_progress_init+2],es + + mov ax,[es:bx+14] + mov [gfx_bc_progress_done],ax + mov [gfx_bc_progress_done+2],es + + mov ax,[es:bx+16] + mov [gfx_bc_progress_update],ax + mov [gfx_bc_progress_update+2],es + + mov ax,[es:bx+18] + mov [gfx_bc_progress_limit],ax + mov [gfx_bc_progress_limit+2],es + + mov ax,[es:bx+20] + mov [gfx_bc_password_init],ax + mov [gfx_bc_password_init+2],es + + mov ax,[es:bx+22] + mov [gfx_bc_password_done],ax + mov [gfx_bc_password_done+2],es + + mov esi,cs + shl esi,4 + add esi,gfx_sysconfig + call far [gfx_bc_init] + jc gfx_init_80 + + mov byte [gfx_ok],1 + + ; turn off 'cwritestr' + mov al,[cwritestr] + cmp al,0c3h + jz gfx_init_90 + mov [gfx_cwritestr_old],al + mov byte [cwritestr],0c3h + + jmp gfx_init_90 + +gfx_init_80: + mov byte [gfx_ok],0 +gfx_init_90: + pop es + ret + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +; Back to text mode. +; +; return: [gfx_ok] = 0 +; +gfx_done: + push ax + cmp byte [gfx_ok],0 + jz gfx_done_90 + call far [gfx_bc_done] + mov byte [gfx_ok],0 + + ; reactivate 'cwritestr' + mov al,[gfx_cwritestr_old] + cmp al,0c3h + jz gfx_done_90 + mov [cwritestr],al +gfx_done_90: + pop ax + ret + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +gfx_input: + cmp byte [gfx_ok],0 + jz gfx_input_90 + cmp byte [gfx_save_area1_used],0 + jz gfx_input_10 + ; recover saved menu layout, gfxboot has references into it + pushad + mov esi,[gfx_save_area1] + mov edi,gfx_menu_seg << 4 + mov ecx,10000h + call bcopy + popad +gfx_input_10: + call far [gfx_bc_input] + jnc gfx_input_50 + mov ax,1 +gfx_input_50: + cmp ax,1 + jnz gfx_input_90 + push ax + call gfx_done + pop ax +gfx_input_90: + ret + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +; es:di string +; return: +; cx length +gfx_strlen: + mov cx,-1 + mov al,0 + repnz scasb + not cx + dec cx + ret + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +gfx_setup_menu: + push es + cmp byte [gfx_ok],0 + jz gfx_setup_menu_90 + + mov dword [menu_desc+menu_default],gfx_menu_seg << 16 + + push ds + pop es + mov si,default_cmd + mov di,trackbuf + call mangle_name + mov si,trackbuf + les di,[menu_desc+menu_default] + call unmangle_name + inc di + + mov [menu_desc+menu_ent_list],di + mov [menu_desc+menu_ent_list+2],es + mov [menu_desc+menu_arg_list],di + mov [menu_desc+menu_arg_list+2],es + + ; first, count entries and find max kernel and append length + + push ds + pop es + + xor si,si + jmp gfx_setup_menu_20 +gfx_setup_menu_10: + push ds + push word vk_seg + pop ds + mov di,VKernelBuf + call rllunpack + pop ds + + ; count only non empty entries + cmp byte [es:VKernelBuf],0 + jz gfx_setup_menu_20 + + inc word [menu_desc+menu_entries] + + push si + mov si,VKernelBuf + mov di,KernelCName + push di + call unmangle_name + pop di + pop si + + call gfx_strlen + + cmp cx,[menu_desc+menu_ent_size] + jbe gfx_setup_menu_15 + mov [menu_desc+menu_ent_size],cx +gfx_setup_menu_15: + mov ax,[VKernelBuf+vk_appendlen] + cmp ax,[menu_desc+menu_arg_size] + jbe gfx_setup_menu_20 + mov [menu_desc+menu_arg_size],ax + +gfx_setup_menu_20: + cmp si,[VKernelBytes] + jb gfx_setup_menu_10 + + inc word [menu_desc+menu_ent_size] + mov ax,[menu_desc+menu_ent_size] + inc ax + add [menu_desc+menu_arg_size],ax + + ; ...and again, but this time copy entries + + mov word [menu_desc+menu_entries],0 + + xor si,si + jmp gfx_setup_menu_60 +gfx_setup_menu_30: + push ds + pop es + push ds + push word vk_seg + pop ds + mov di,VKernelBuf + call rllunpack + pop ds + + ; count only non empty entries + cmp byte [es:VKernelBuf],0 + jz gfx_setup_menu_60 + + mov di,[menu_desc+menu_arg_list] + add di,[menu_desc+menu_arg_size] + jc gfx_setup_menu_60 + + inc word [menu_desc+menu_entries] + + push si + + mov si,VKernelBuf + mov di,KernelCName + push ds + pop es + push di + call unmangle_name + pop si + mov cx,[menu_desc+menu_ent_size] + les di,[menu_desc+menu_arg_list] + + rep movsb + + mov cx,[VKernelBuf+vk_appendlen] + mov si,VKernelBuf+vk_append + rep movsb + mov byte [es:di],0 + + pop si + + mov ax,[menu_desc+menu_arg_size] + add [menu_desc+menu_arg_list],ax + +gfx_setup_menu_60: + cmp si,[VKernelBytes] + jb gfx_setup_menu_30 + + mov ax,[menu_desc+menu_ent_size] + mov bx,[menu_desc+menu_arg_size] + mov [menu_desc+menu_ent_size],bx + add ax,[menu_desc+menu_ent_list] + mov [menu_desc+menu_arg_list],ax + + mov esi,ds + shl esi,4 + add esi,menu_desc + + call far [gfx_bc_menu_init] + + ; save menu structure, gfxboot uses references into it + mov edi,[gfx_save_area1] + or edi,edi + jz gfx_setup_menu_90 + mov esi,gfx_menu_seg << 4 + mov ecx,10000h + call bcopy + mov byte [gfx_save_area1_used],1 + +gfx_setup_menu_90: + pop es + ret + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +gfx_infobox: + pushad + cmp byte [gfx_ok],0 + jz gfx_infobox_90 + mov ecx,ds + shl ecx,4 + movzx esi,si + movzx edi,di + or si,si + jz gfx_infobox_20 + add esi,ecx +gfx_infobox_20: + or di,di + jz gfx_infobox_30 + add edi,ecx +gfx_infobox_30: + call far [gfx_bc_infobox_init] + xor edi,edi + xor eax,eax + call far [gfx_bc_input] + call far [gfx_bc_infobox_done] +gfx_infobox_90: + popad + ret + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +gfx_progress_init: + pushad + cmp byte [gfx_ok],0 + jz gfx_progress_init_90 + call far [gfx_bc_progress_init] +gfx_progress_init_90: + popad + ret + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +gfx_progress_done: + pushad + cmp byte [gfx_ok],0 + jz gfx_progress_done_90 + call far [gfx_bc_progress_done] +gfx_progress_done_90: + popad + ret + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +gfx_progress_update: + pushad + cmp byte [gfx_ok],0 + jz gfx_progress_update_90 + movzx eax,cx + call far [gfx_bc_progress_update] +gfx_progress_update_90: + popad + ret + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +gfx_progress_limit: + pushad + cmp byte [gfx_ok],0 + jz gfx_progress_limit_90 + movzx eax,ax + movzx edx,dx + call far [gfx_bc_progress_limit] +gfx_progress_limit_90: + popad + ret + + +%if 0 +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +gfx_password: + pushad + cmp byte [gfx_ok],0 + stc + jz gfx_password_90 + call far [gfx_bc_password_init] + mov edi,ds + shl edi,4 + add edi,gfx_password_buf + mov ecx,32 + xor eax,eax + call far [gfx_bc_input] + mov esi,ds + shl esi,4 + add esi,gfx_password_buf + call far [gfx_bc_password_done] + jnc gfx_password_90 + mov esi,ds + shl esi,4 + add esi,gfx_msg_wrong_password + xor edi,edi + mov al,0 + call far [gfx_bc_infobox_init] + xor edi,edi + xor eax,eax + call far [gfx_bc_input] + call far [gfx_bc_infobox_done] + stc +gfx_password_90: + popad + ret +%endif + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +; Read graphics data and store them at [gfx_mem]. +; +; dx:ax file length +; si start cluster +; +; return: [gfx_ok] = 0/1 +; +gfx_read_file: + push es + mov byte [gfx_ok],0 + mov edi,[gfx_mem] + push dx ; DX:AX = length of file + push ax + pop edx + mov [gfx_archive_end],edx + mov eax,[gfx_mem0_start] + lea eax,[eax+edx+0fh] ; add space for alignment + cmp eax,[gfx_mem0_end] ; max. length + ja near gfx_read_file_90 + mov [gfx_mem0_start],eax + +gfx_read_file_10: + mov bx,trackbuf + mov cx,[BufSafe] + push edi + push edx + call getfssec + pop edx + pop edi + movzx ecx,word [BufSafeBytes] + cmp edx,ecx + jae gfx_read_file_20 + mov ecx,edx +gfx_read_file_20: + push ecx + push edi + push si ; Save current cluster + push es + mov si,trackbuf + push edi + call gfx_l2so + pop di + pop es + rep movsb + pop es + pop si + pop edi + pop ecx + add edi,ecx + sub edx,ecx + ja gfx_read_file_10 + + call find_file + or eax,eax + jz gfx_read_file_90 + push edi + push eax + add eax,edi + call align_it + pop eax + pop edi + sub edi,[gfx_mem] + mov ecx,[gfx_archive_start] + add edi,ecx + mov [gfx_file],edi + add [gfx_archive_end],ecx + add eax,edi + shr eax,4 + mov [gfx_bc_jt+2],ax + + mov byte [gfx_ok],1 + +gfx_read_file_90: + pop es + ret + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +; locate graphics file +; +; return: eax: code offset (0 -> no file found) +; edi: gfx file start +; +find_file: + mov edi,[gfx_mem] + lin2segofs edi,es,bx + call magic_ok + or eax,eax + jnz find_file_90 + + ; ok, maybe it's a cpio archive + + ; note: edi must be properly aligned (2)! + +find_file_20: + mov ecx,[gfx_mem0_start] + sub ecx,26 + 12 ; min cpio header + gfx header + cmp edi,ecx + jae find_file_90 + + lin2segofs edi,es,bx + cmp word [es:bx],71c7h + jz find_file_30 ; normal cpio record + cmp word [es:bx],0c771h ; maybe byte-swapped? + jnz find_file_90 ; no cpio record + mov byte [gfx_cpio_swab],1 + +find_file_30: + mov ax,[es:bx+20] ; file name size + call cpio_swab + movzx esi,ax + + inc si + and si,~1 ; align + + mov eax,[es:bx+22] ; data size + call cpio_swab + rol eax,16 ; get word order right + call cpio_swab + mov ecx,eax + + inc ecx + and ecx,byte ~1 ; align + + add si,26 ; skip header + + add edi,esi + add bx,si + call magic_ok + or eax,eax + jnz find_file_90 + + add edi,ecx + jmp find_file_20 + +find_file_90: + ret + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +; byte-swap cpio data if appropriate +; +; ax: word to swap +; +; return: ax: swapped if [gfx_cpio_swab], otherwise same as input +; +cpio_swab: + cmp byte [gfx_cpio_swab],0 + jz cpio_swab_90 + xchg ah,al + +cpio_swab_90: + ret + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +; es:bx file start +; +; return: eax: offset to code entry +; +; Notes: +; - changes no regs except eax +; +magic_ok: + xor eax,eax + cmp dword [es:bx],0b2d97f00h ; header.magic_id + jnz magic_ok_90 + cmp byte [es:bx+4],8 ; header.version + jnz magic_ok_90 + mov eax,[es:bx+8] +magic_ok_90: + ret + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +; eax address to be aligned +; +align_it: + push dword [gfx_mem] + pop dword [gfx_archive_start] + neg al + and eax,byte 0fh + jz align_it_90 + add [gfx_archive_start],eax + mov esi,[gfx_mem] + mov ebx,[gfx_mem0_start] + sub ebx,esi + sub ebx,byte 0fh + add esi,ebx + dec esi + + std + +align_it_30: + or ebx,ebx + jz align_it_60 + mov ecx,ebx + cmp ebx,8000h + jb align_it_40 + mov ecx,8000h +align_it_40: + push esi + sub ebx,ecx + sub [esp],ecx + push esi + call gfx_l2so + pop si + add si,8000h + sub word [esp],(8000h >> 4) + pop es + mov di,si + add di,ax + es rep movsb + pop esi + jmp align_it_30 +align_it_60: + + cld + +align_it_90: + ret + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +; Ask user whether to continue. +; +; don't change regs +; +ask_user: + pushad + + mov si,failsafe_msg_0 + call cwritestr + + mov dx,2 + mov si,failsafe_msg_1 + call ask_question + + test byte [gfx_failsafe],2 + jnz ask_user_90 + + mov dx,4 + mov si,failsafe_msg_2 + call ask_question + +ask_user_90: + + popad + ret + + +; si: text +; dh: 'yes'-mask +; dl: 'no'-mask +ask_question: + push dx + call cwritestr + mov si,failsafe_msg_q + call cwritestr + pop dx + +ask_question_20: + push dx + mov ah,0 + int 16h + pop dx + + cmp al,13 + jnz ask_question_30 + mov al,'y' +ask_question_30: + or al,20h ; force lower case + + cmp al,'y' + jz ask_question_40 + cmp al,'n' + jnz ask_question_20 + or byte [gfx_failsafe],dl + jmp ask_question_50 +ask_question_40: + or byte [gfx_failsafe],dh +ask_question_50: + + mov si,failsafe_key + mov [si],al + call cwritestr + + ret + +failsafe_msg_q db ' (y/n)? y', 8, 0 + +failsafe_msg_0 db 13, 10, 10, 10, 0 +failsafe_msg_1 db 'Load boot graphics', 0 +failsafe_msg_2 db 'Detect display size', 0 + +failsafe_key db 0, 13, 10, 0 + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +; Convert 32bit linear address to seg:ofs. +; +; dword [esp + 2]: linear address +; +; return: +; dword [esp + 2]: seg:ofs +; +; Notes: +; - changes no regs +; +gfx_l2so: + push eax + mov eax,[esp + 6] + shr eax,4 + mov [esp + 8],ax + and word [esp + 6],byte 0fh + pop eax + ret + + +; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +; +cb_table dw cb_status + dw cb_fopen + dw cb_fread + dw cb_getcwd + dw cb_chdir + dw cb_readsector +cb_len equ ($-cb_table)/2 + +f_handle dw 0 +f_size dd 0 +fname_buf times 64 db 0 +fname_buf_len equ $ - fname_buf + + +gfx_cb: + push cs + pop ds + + cmp al,cb_len + jae gfx_cb_80 + + movzx bx,al + add bx,bx + call word [bx+cb_table] + jmp gfx_cb_90 + +gfx_cb_80: + mov al,0ffh +gfx_cb_90: + retf + + +; Return status info. +; +; return: +; edx filename buffer (64 bytes) +; +cb_status: + mov edx,cs + shl edx,4 + add edx,fname_buf + + xor al,al + ret + +; Open file. +; +; return: +; al 0: ok, 1: file not found +; ecx file length (al = 0) +; +cb_fopen: + mov si,fname_buf + mov di,VGAFileMBuf ; we just need some space + push ds + pop es + push di + call mangle_name + pop di + call searchdir + xchg ax,bx + mov al,1 + jz cb_fopen_90 + mov [f_handle],si + mov cx,dx + shl ecx,16 + mov cx,bx + mov [f_size],ecx +cb_fopen_80: + xor al,al +cb_fopen_90: + ret + + +; Read next chunk. +; +; return: +; edx buffer address (linear) +; ecx data length (< 64k) +; +cb_fread: + cmp dword [f_size],0 + jz cb_fread_80 + push cs + pop es + mov bx,trackbuf + mov cx,[BufSafe] + mov si,[f_handle] + call getfssec + mov [f_handle],si + mov ecx,[f_size] + movzx edx,word [BufSafeBytes] + cmp ecx,edx + jbe cb_fread_50 + mov ecx,edx +cb_fread_50: + sub [f_size],ecx + mov edx,cs + shl edx,4 + add edx,trackbuf + +cb_fread_80: + xor al,al +cb_fread_90: + ret + + +; Return current working directory. +; +; return: +; edx filename +; +cb_getcwd: + mov edx,cs + shl edx,4 +%if IS_ISOLINUX + add edx,isolinux_dir +%else + add edx,gfx_slash +%endif + xor al,al + ret + + +; Set current working directory. +; +cb_chdir: +%if IS_ISOLINUX + + push cs + pop es + mov si,fname_buf + mov di,isolinux_dir +cb_chdir_20: + lodsb + stosb + or al,al + jz cb_chdir_60 + cmp di,isolinux_cfg - 1 + jb cb_chdir_20 + xor al,al + stosb +cb_chdir_60: + call get_fs_structures + +%endif + xor al,al + ret + + +; read sector +; +; edx sector +; +; return: +; edx buffer (linear address) +; +; Note: does not return on error! +; +cb_readsector: + mov eax,edx + push ds + pop es + mov bx,trackbuf + call getonesec + mov edx,ds + shl edx,4 + add edx,trackbuf + xor al,al + ret + diff -uNr syslinux-3.61/isolinux.asm syslinux-3.61-new/isolinux.asm --- syslinux-3.61/isolinux.asm 2008-02-04 07:58:50 +0300 +++ syslinux-3.61-new/isolinux.asm 2008-02-13 22:15:48 +0300 @@ -19,6 +19,10 @@ ; **************************************************************************** %define IS_ISOLINUX 1 + +%define WITH_GFX 1 +; %define DEBUG_DISKIO + %include "head.inc" ; @@ -71,6 +75,7 @@ vk_seg equ 2000h ; Virtual kernels xfer_buf_seg equ 1000h ; Bounce buffer for I/O to high mem comboot_seg equ real_mode_seg ; COMBOOT image loading zone +first_free_seg equ 4000h ; end of isolinux used memory ; ; File structure. This holds the information for each currently open file. @@ -272,6 +277,22 @@ mov [FirstSecSum],edi mov [DriveNumber],dl + + ; check whether the BIOS did load us correctly + cmp dl,80h ; some BIOSes try to do floppy emulation... + jb bios_err + cmp dword [FirstSecSum], byte 0 + jz bios_ok +bios_err: + mov si,broken_bios_msg + call writemsg + jmp short $ +broken_bios_msg db 13, 10, 'Cannot boot from this CD. Please use CD2 or try a BIOS update.', 13, 10, 0 + align 4 +csum_value dd 0 +bios_ok: + + %ifdef DEBUG_MESSAGES mov si,startup_msg call writemsg @@ -296,6 +317,9 @@ ; Other nonzero fields inc word [dsp_sectors] +%if 0 + ; Some BIOSes don't like that call. + ; Now figure out what we're actually doing ; Note: use passed-in DL value rather than 7Fh because ; at least some BIOSes will get the wrong value otherwise @@ -316,6 +340,8 @@ call crlf %endif +%endif + found_drive: ; Alright, we have found the drive. Now, try to find the ; boot file itself. If we have a boot info table, life is @@ -440,6 +466,9 @@ %endif jmp all_read ; Jump to main code +%if 0 + ; doesn't work anyway, see above + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Start of BrokenAwardHack --- 10-nov-2002 Knut_Petersen@t-online.de ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -623,6 +652,7 @@ mov si,trysbm_msg call writemsg jmp .found_drive ; Pray that this works... +%endif fatal_error: mov si,nothing_msg @@ -703,6 +733,16 @@ mov bx,es mov [si+6],bx mov [si+8],eax + ; seems that some BIOSes have problems if the target + ; segment is 0 (don't ask); to avoid this, we normalize + ; the buffer address here + ; -> seen on Acer TravelMate C102Ti + mov [si+4],bx + and word [si+4],0fh + mov ax,es + shr bx,4 + add ax,bx + mov [si+6],ax .loop: push bp ; Sectors left cmp bp,[MaxTransfer] @@ -729,14 +769,77 @@ ; INT 13h with retry xint13: mov byte [RetryCount],retry_count .try: pushad +%ifdef DEBUG_DISKIO + pushad + mov cx,16 +.zap: + lodsb + call writehex2 + mov al,' ' + call writechr + loop .zap + mov ah,0 + int 16h + popad +%endif + ; seen buggy bios that overwrites buffer address on error... + push dword [dapa + 4] call int13 + pop dword [dapa + 4] +%ifdef DEBUG_DISKIO + pushad + pushf + push ax + mov al,':' + call writechr + mov al,' ' + call writechr + pop ax + sbb al,al + call writehex4 + call crlf + mov ah,0 + int 16h + popf + popad +%endif jc .error +noerror: add sp,byte 8*4 ; Clean up stack ret .error: + or ah,ah + jz .noerror mov [DiskError],ah ; Save error code popad mov [DiskSys],ax ; Save system call number + +%if 0 + ; eject currently not supported - doesn't work anyway with + ; most BIOSes + + test byte [gfx_user_note],1 + jz .noeject + cmp byte [RetryCount],4 + ja .noeject + cmp byte [DiskError],0aah ; drive not ready + jnz .noeject + ; might have been cdrom eject, wait a bit + cmp byte [gfx_ok],0 + jz .noeject + push si + push di + push ax + mov si,err_not_ready + xor di,di + mov al,0 + call gfx_infobox + pop ax + pop di + pop si +%endif +.noeject: + dec byte [RetryCount] jz .real_error push ax @@ -779,6 +882,16 @@ ; kaboom: RESET_STACK_AND_SEGS AX + + cmp byte [gfx_ok],0 + jz .nogfx + mov si,err_failed_gfx + xor di,di + mov al,1 + call gfx_infobox + call gfx_done + call do_reboot +.nogfx: mov si,err_bootfailed call cwritestr call getchar @@ -830,6 +943,9 @@ crlf_msg db CR, LF null_msg db 0 +err_failed_gfx db 'Error reading boot CD.', 0 +err_not_ready db 'CDROM drive not ready.', 0 + alignb 4, db 0 MaxTransfer dw 32 ; Max sectors per transfer @@ -887,6 +1003,9 @@ ; (which will be at 16 only for a single-session disk!); from the PVD ; we should be able to find the rest of what we need to know. ; + call get_fs_structures + jmp get_fs_struct_done + get_fs_structures: mov eax,[bi_pvd] mov bx,trackbuf @@ -912,10 +1031,15 @@ ; Look for an isolinux directory, and if found, ; make it the current directory instead of the root ; directory. + + cmp byte [gfx_ok],0 ; don't look at both + jnz .gfx + mov di,boot_dir ; Search for /boot/isolinux mov al,02h call searchdir_iso jnz .found_dir +.gfx: mov di,isolinux_dir mov al,02h ; Search for /isolinux call searchdir_iso @@ -936,6 +1060,9 @@ call crlf %endif .no_isolinux_dir: + ret + +get_fs_struct_done: ; ; Locate the configuration file @@ -1101,6 +1228,9 @@ ; 0xFFFF in case we should execute INT 18h ("next device.") ; local_boot: +%ifdef WITH_GFX + call gfx_done +%endif call vgaclearmode lss sp,[cs:Stack] ; Restore stack pointer xor dx,dx @@ -1118,7 +1248,7 @@ xor dh,dh push dx xor ax,ax ; Reset drive - call xint13 + int 13h ; we don't care about errors here... mov ax,0201h ; Read one sector mov cx,0001h ; C/H/S = 0/0/1 (first sector) mov bx,trackbuf @@ -1495,6 +1625,9 @@ %include "rawcon.inc" ; Console I/O w/o using the console functions %include "adv.inc" ; Auxillary Data Vector +%include "gfxboot.inc" ; add gfx things + + ; ----------------------------------------------------------------------------- ; Begin data section ; ----------------------------------------------------------------------------- @@ -1504,9 +1637,11 @@ localboot_msg db 'Booting from local disk...', CR, LF, 0 default_str db 'default', 0 default_len equ ($-default_str) +err_noinitrda db 'Could not find ramdisk image: ', 0 boot_dir db '/boot' ; /boot/isolinux isolinux_dir db '/isolinux', 0 config_name db 'isolinux.cfg', 0 + zb 64 err_disk_image db 'Cannot load disk image (invalid file)?', CR, LF, 0 %ifdef DEBUG_MESSAGES Файлы syslinux-3.61/isolinux.bin и syslinux-3.61-new/isolinux.bin различаются diff -uNr syslinux-3.61/keywords syslinux-3.61-new/keywords --- syslinux-3.61/keywords 2008-02-04 07:58:50 +0300 +++ syslinux-3.61-new/keywords 2008-02-13 21:58:16 +0300 @@ -42,3 +42,5 @@ f10 f11 f12 +gfxboot +disksize diff -uNr syslinux-3.61/keywords.inc syslinux-3.61-new/keywords.inc --- syslinux-3.61/keywords.inc 2008-02-04 07:58:51 +0300 +++ syslinux-3.61-new/keywords.inc 2008-02-13 21:58:16 +0300 @@ -90,8 +90,16 @@ %if IS_PXELINUX keyword ipappend, pc_ipappend %endif -%if IS_PXELINUX || IS_ISOLINUX - keyword localboot, pc_localboot +%if IS_PXELINUX || IS_ISOLINUX || IS_SYSLINUX + keyword localboot, pc_localboot %endif +%ifdef WITH_GFX + keyword gfxboot, pc_filecmd, get_gfx_file +%if IS_SYSLINUX + keyword disksize, pc_disksize, DiskSize +%endif +%endif + + keywd_count equ ($-keywd_table)/keywd_size diff -uNr syslinux-3.61/kwdhash.gen syslinux-3.61-new/kwdhash.gen --- syslinux-3.61/kwdhash.gen 2008-02-04 07:59:01 +0300 +++ syslinux-3.61-new/kwdhash.gen 2008-02-13 21:58:18 +0300 @@ -42,3 +42,5 @@ hash_f10 equ 0x00019e10 hash_f11 equ 0x00019e11 hash_f12 equ 0x00019e12 +hash_gfxboot equ 0x0bb0b18d +hash_disksize equ 0xa088281f diff -uNr syslinux-3.61/layout.inc syslinux-3.61-new/layout.inc --- syslinux-3.61/layout.inc 2008-02-04 07:58:51 +0300 +++ syslinux-3.61-new/layout.inc 2008-02-13 21:58:16 +0300 @@ -26,7 +26,12 @@ ; The secondary BSS section, above the text; we really wish we could ; just make it follow .bcopy32 or hang off the end, ; but it doesn't seem to work that way. -LATEBSS_START equ 0B800h + +%ifdef WITH_GFX + LATEBSS_START equ 0B800h +%else + LATEBSS_START equ 0B300h +%endif ; Reserve memory for the stack. This causes checkov to abort the ; compile if we violate this space. diff -uNr syslinux-3.61/ldlinux.asm syslinux-3.61-new/ldlinux.asm --- syslinux-3.61/ldlinux.asm 2008-02-04 07:58:51 +0300 +++ syslinux-3.61-new/ldlinux.asm 2008-02-13 22:01:57 +0300 @@ -24,6 +24,9 @@ %ifndef IS_MDSLINUX %define IS_SYSLINUX 1 %endif + +%define WITH_GFX 1 + %include "head.inc" ; @@ -83,6 +86,7 @@ vk_seg equ 2000h ; Virtual kernels xfer_buf_seg equ 1000h ; Bounce buffer for I/O to high mem comboot_seg equ real_mode_seg ; COMBOOT image loading zone +first_free_seg equ 5000h ; end of syslinux used memory ; ; File structure. This holds the information for each currently open file. @@ -371,6 +375,8 @@ add eax,[bsHidden] ; Add partition offset xor edx,edx ; Zero-extend LBA (eventually allow 64 bits) +.patch: jmp strict near .jmp + .jmp: jmp strict short getlinsec_cbios ; @@ -920,6 +926,50 @@ ; %include "ui.inc" +; Boot a specified local disk. AX specifies the BIOS disk number; or +; 0xFFFF in case we should execute INT 18h ("next device.") +; +local_boot: +%ifdef WITH_GFX + call gfx_done +%endif + call vgaclearmode + lss sp,[cs:Stack] ; Restore stack pointer + xor dx,dx + mov ds,dx + mov es,dx + mov fs,dx + mov gs,dx + mov si,localboot_msg + call cwritestr + cmp ax,-1 + je .int18 + + ; Load boot sector from the specified BIOS device and jump to it. + mov dl,al + xor dh,dh + push dx + xor ax,ax ; Reset drive + int 13h + mov ax,0201h ; Read one sector + mov cx,0001h ; C/H/S = 0/0/1 (first sector) + mov bx,trackbuf + int 13h + pop dx + cli ; Abandon hope, ye who enter here + mov si,trackbuf + mov di,07C00h + mov cx,512 ; Probably overkill, but should be safe + rep movsd + mov ss,cx + mov sp,7c00h + jmp 0:07C00h ; Jump to new boot sector + +.int18: + int 18h ; Hope this does the right thing... + jmp kaboom ; If we returned, oh boy... + + ; ; allocate_file: Allocate a file structure ; @@ -1140,6 +1190,15 @@ ; starting with "kaboom.patch" with this part kaboom2: + cmp byte [gfx_ok],0 + jz .nogfx + mov si,err_failed_gfx + xor di,di + mov al,1 + call gfx_infobox + call gfx_done + call do_reboot +.nogfx: mov si,err_bootfailed call cwritestr cmp byte [kaboom.again+1],18h ; INT 18h version? @@ -1544,6 +1603,8 @@ %include "cache.inc" ; Metadata disk cache %include "adv.inc" ; Auxillary Data Vector +%include "gfxboot.inc" ; add gfx things + ; ----------------------------------------------------------------------------- ; Begin data section ; ----------------------------------------------------------------------------- @@ -1551,8 +1612,11 @@ section .data copyright_str db ' Copyright (C) 1994-', year, ' H. Peter Anvin' db CR, LF, 0 +err_noinitrda db 'Could not find ramdisk image: ', 0 err_bootfailed db CR, LF, 'Boot failed: please change disks and press ' db 'a key to continue.', CR, LF, 0 +err_failed_gfx db 'Error reading from disk.', 0 +localboot_msg db 'Booting from local disk...', CR, LF, 0 syslinux_cfg1 db '/boot' ; /boot/syslinux/syslinux.cfg syslinux_cfg2 db '/syslinux' ; /syslinux/syslinux.cfg syslinux_cfg3 db '/' ; /syslinux.cfg Файлы syslinux-3.61/ldlinux.bin и syslinux-3.61-new/ldlinux.bin различаются Файлы syslinux-3.61/ldlinux.bss и syslinux-3.61-new/ldlinux.bss различаются Файлы syslinux-3.61/ldlinux.sys и syslinux-3.61-new/ldlinux.sys различаются diff -uNr syslinux-3.61/loadhigh.inc syslinux-3.61-new/loadhigh.inc --- syslinux-3.61/loadhigh.inc 2008-02-04 07:58:51 +0300 +++ syslinux-3.61-new/loadhigh.inc 2008-02-13 21:58:16 +0300 @@ -47,7 +47,12 @@ .read_loop: and si,si ; If SI == 0 then we have end of file jz .eof +%ifdef WITH_GFX + cmp byte [gfx_ok],0 + jnz .no_message +%endif call bx +.no_message: push bx ; Pausebird function push eax ; Total bytes to transfer @@ -63,7 +68,15 @@ push edi ; Target buffer mov cx,ax xor bx,bx ; ES:0 + +%ifdef WITH_GFX + call gfx_progress_update +%endif + + push dx call getfssec ; Load the data into xfer_buf_seg + ; getfssec destroys dx! + pop dx pop edi ; Target buffer pop ecx ; Byte count this round push ecx ; Byte count this round diff -uNr syslinux-3.61/Makefile syslinux-3.61-new/Makefile --- syslinux-3.61/Makefile 2008-02-04 07:58:48 +0300 +++ syslinux-3.61-new/Makefile 2008-02-13 21:58:16 +0300 @@ -74,7 +74,7 @@ BTARGET = kwdhash.gen version.gen version.h \ ldlinux.bss ldlinux.sys ldlinux.bin \ pxelinux.0 isolinux.bin isolinux-debug.bin \ - extlinux.bin extlinux.bss extlinux.sys + extlinux.bin extlinux.bss extlinux.sys gfxboot.inc BOBJECTS = $(BTARGET) mbr/mbr.bin dos/syslinux.com win32/syslinux.exe \ memdisk/memdisk memdump/memdump.com # BESUBDIRS and IESUBDIRS are "early", i.e. before the root; BSUBDIRS diff -uNr syslinux-3.61/memdisk/.depend syslinux-3.61-new/memdisk/.depend --- syslinux-3.61/memdisk/.depend 1970-01-01 03:00:00 +0300 +++ syslinux-3.61-new/memdisk/.depend 2008-02-13 21:58:16 +0300 @@ -0,0 +1,30 @@ +conio.o: conio.c ../com32/include/stdint.h memdisk.h \ + ../com32/include/com32.h ../com32/include/klibc/compiler.h conio.h \ + ../com32/include/stddef.h ../com32/include/bitsize/stddef.h \ + ../com32/include/stdarg.h +e820func.o: e820func.c ../com32/include/stdint.h memdisk.h \ + ../com32/include/com32.h ../com32/include/klibc/compiler.h e820.h +e820test.o: e820test.c ../com32/include/string.h \ + ../com32/include/klibc/extern.h ../com32/include/stddef.h \ + ../com32/include/bitsize/stddef.h ../com32/include/stdio.h \ + ../com32/include/stdarg.h ../com32/include/stdlib.h \ + ../com32/include/klibc/compiler.h ../com32/include/inttypes.h \ + ../com32/include/stdint.h e820.h +inflate.o: inflate.c +msetup.o: msetup.c ../com32/include/stdint.h memdisk.h \ + ../com32/include/com32.h ../com32/include/klibc/compiler.h conio.h \ + ../com32/include/stddef.h ../com32/include/bitsize/stddef.h \ + ../com32/include/stdarg.h e820.h +setup.o: setup.c ../com32/include/stdint.h e820.h conio.h \ + ../com32/include/stddef.h ../com32/include/bitsize/stddef.h \ + ../com32/include/stdarg.h version.h memdisk.h ../com32/include/com32.h \ + ../com32/include/klibc/compiler.h +unzip.o: unzip.c ../com32/include/stdint.h memdisk.h \ + ../com32/include/com32.h ../com32/include/klibc/compiler.h conio.h \ + ../com32/include/stddef.h ../com32/include/bitsize/stddef.h \ + ../com32/include/stdarg.h inflate.c +memcpy.o: memcpy.S +memset.o: memset.S +start32.o: start32.S +memdisk.bin: memdisk.asm +memdisk16.bin: memdisk16.asm diff -uNr syslinux-3.61/mkdiskimage syslinux-3.61-new/mkdiskimage --- syslinux-3.61/mkdiskimage 2008-02-04 07:59:05 +0300 +++ syslinux-3.61-new/mkdiskimage 1970-01-01 03:00:00 +0300 @@ -1,321 +0,0 @@ -#!/usr/bin/perl -## ----------------------------------------------------------------------- -## -## Copyright 2002-2008 H. Peter Anvin - All Rights Reserved -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, Inc., 53 Temple Place Ste 330, -## Boston MA 02111-1307, USA; either version 2 of the License, or -## (at your option) any later version; incorporated herein by reference. -## -## ----------------------------------------------------------------------- - -# -# Creates a blank MS-DOS formatted hard disk image -# - -use bytes; -use integer; -use Fcntl; -use Errno; -use Cwd; -use IO::Handle; # For flush() - -sub absolute_path($) { - my($f) = @_; - my($c); - - return $f if ( $f =~ /^\// ); - $c = cwd(); - $c = '' if ( $c eq '/' ); - return $c.'/'.$f; -} - -sub is_linux() { - return !!eval '{ '. - 'use POSIX; '. - '($sysname, $nodename, $release, $version, $machine) = POSIX::uname(); '. - "return \$sysname eq \'Linux\'; }"; -} - -sub get_random() { - # Get a 32-bit random number - my $rfd, $rnd; - my $rid; - - if (sysopen($rfd, '/dev/urandom', O_RDONLY) && - sysread($rfd, $rnd, 4) == 4) { - $rid = unpack("V", $rnd); - } - - close($rfd) if (defined($rfd)); - return $rid if (defined($rid)); - - # This sucks but is better than nothing... - return ($$+time()) & 0xffffffff; -} - -$is_linux = is_linux(); -if ( $is_linux ) { - # IOCTL numbers - $BLKRRPART = 0x125f; - $BLKGETSIZE = 0x1260; -} - -%opt = (); -@args = (); - -while (defined($a = shift(@ARGV))) { - if ( $a =~ /^\-/ ) { - foreach $o ( split(//, substr($a,1)) ) { - $opt{$o} = 1; - if ($o eq 'i') { - $id = shift(@ARGV); - } - } - } else { - push(@args, $a); - } -} - -($file,$c,$h,$s) = @args; -$c += 0; $h += 0; $s += 0; - -$pentry = 1; -$pentry = 2 if ( $opt{'2'} ); -$pentry = 3 if ( $opt{'3'} ); -$pentry = 4 if ( $opt{'4'} ); - -if ( $opt{'z'} ) { - $h = $h || 64; - $s = $s || 32; -} - -if ( $opt{'M'} && $h && $s ) { - # Specify size in megabytes, not in cylinders - $c = ($c*1024*2)/($h*$s); -} - -$is_open = 0; - -if ( $c == 0 && $file ne '' ) { - $len = 0; - if ( sysopen(OUTPUT, $file, O_RDWR, 0666) ) { - $is_open = 1; - - if ( (@filestat = stat(OUTPUT)) && S_ISREG($filestat[2]) ) { - $len = $filestat[7] >> 9; - } elsif ( $is_linux && S_ISBLK($filestat[2]) ) { - $blksize = pack("L!", 0); - if ( ioctl(OUTPUT, $BLKGETSIZE, $blksize) == 0 ) { - $len = unpack("L!", $blksize); # In 512-byte sectors! - } - } - } - - if ( !$len ) { - print STDERR "$0: $file: don't know how to determine the size of this device\n"; - exit 1; - } - - $c = $len/($h*$s); -} - -if ( $file eq '' || $c < 1 || $h < 1 || $h > 256 || $s < 1 || $s > 63 ) { - print STDERR "Usage: $0 [-doFMz4][-i id] file c h s (max: 1024 256 63)\n"; - print STDERR " -d add DOSEMU header\n"; - print STDERR " -o print filesystem offset to stdout\n"; - print STDERR " -F format partition as FAT32\n"; - print STDERR " -M \"c\" argument is megabytes, calculate cylinders\n"; - print STDERR " -z use zipdisk geometry (h=64 s=32)\n"; - print STDERR " -4 use partition entry 4 (standard for zipdisks)\n"; - print STDERR " -i specify the MBR ID\n"; - exit 1; -} - -if ($c > 1024) { - print STDERR "Warning: more than 1024 cylinders ($c).\n"; - print STDERR "Not all BIOSes will be able to boot this device.\n"; - $cc = 1024; -} else { - $cc = $c; -} - -$cylsize = $h*$s*512; - -if ( !$is_open ) { - sysopen(OUTPUT, $file, O_CREAT|O_RDWR|O_TRUNC, 0666) - or die "$0: Cannot open: $file\n"; -} -binmode OUTPUT; - -# Print out DOSEMU header, if requested -if ( $opt{'d'} ) { - $emuhdr = "DOSEMU\0" . pack("VVVV", $h, $s, $c, 128); - $emuhdr .= "\0" x (128 - length($emuhdr)); - print OUTPUT $emuhdr; -} - -# Print the MBR and partition table -$mbr = ''; -while ( $line = ) { - chomp $line; - foreach $byte ( split(/\s+/, $line) ) { - $mbr .= chr(hex($byte)); - } -} -if ( length($mbr) > 440 ) { - die "$0: Bad MBR code\n"; -} - -$mbr .= "\0" x (440 - length($mbr)); -if (defined($id)) { - $id = to_int($id); -} else { - $id = get_random(); -} -$mbr .= pack("V", $id); # Offset 440: MBR ID -$mbr .= "\0\0"; # Offset 446: actual partition table - -print OUTPUT $mbr; - -# Print partition table -$psize = $c*$h*$s-$s; -$bhead = ($h > 1) ? 1 : 0; -$bsect = 1; -$bcyl = ($h > 1) ? 0 : 1; -$ehead = $h-1; -$esect = $s + ((($cc-1) & 0x300) >> 2); -$ecyl = ($cc-1) & 0xff; -if ( $c > 1024 ) { - $fstype = 0x0e; -} elsif ( $psize > 65536 ) { - $fstype = 0x06; -} else { - $fstype = 0x04; -} -for ( $i = 1 ; $i <= 4 ; $i++ ) { - if ( $i == $pentry ) { - print OUTPUT pack("CCCCCCCCVV", 0x80, $bhead, $bsect, $bcyl, $fstype, - $ehead, $esect, $ecyl, $s, $psize); - } else { - print OUTPUT "\0" x 16; - } -} -print OUTPUT "\x55\xaa"; - -# Output blank file -$totalsize = $c*$h*$s; -$tracks = $c*$h; - -$track = "\0" x (512*$s); - -# Print fractional track -print OUTPUT "\0" x (512 * ($s-1)); - -for ( $i = 1 ; $i < $tracks ; $i++ ) { - print OUTPUT $track; -} - -# Print mtools temp file -$n = 0; -while ( !defined($tmpdir) ) { - $tmpdir = "/tmp/mkdiskimage.$$.".($n++); - if ( !mkdir($tmpdir, 0700) ) { - die "$0: Failed to make temp directory: $tmpdir\n" - if ( $! != EEXIST ); - undef $tmpdir; - } -} - -$cfgfile = $tmpdir.'/mtools.conf'; -$imglink = $tmpdir.'/disk.img'; -die "$0: Failed to create symlink $imglink\n" - if ( !symlink(absolute_path($file), $imglink) ); - -$header_size = ($opt{'d'} ? 128 : 0); - -# Start of filesystem -$offset = $s*512 + $header_size; - -# Start of partition table entry -$pstart = $header_size + 446 + 16*($pentry-1); - -open(MCONFIG, "> ${cfgfile}") or die "$0: Cannot make mtools config\n"; -print MCONFIG "drive z:\n"; -print MCONFIG "file=\"${imglink}\"\n"; -print MCONFIG "cylinders=${c}\n"; -print MCONFIG "heads=${h}\n"; -print MCONFIG "sectors=${s}\n"; -print MCONFIG "offset=${offset}\n"; -print MCONFIG "mformat_only\n"; -close(MCONFIG); - -# Output the filesystem offset to stdout if appropriate -if ( $opt{'o'} ) { - print $offset, "\n"; -} - -$ENV{'MTOOLSRC'} = $cfgfile; -if ( $opt{'F'} ) { - system('mformat', '-F', 'z:'); -} else { - system('mformat', 'z:'); -} - -# Clean up in /tmp -unlink($cfgfile); -unlink($imglink); -rmdir($tmpdir); - -# MTOOLS doesn't write the bsHiddenSecs field correctly -seek(OUTPUT, $offset + 0x1c, 0); -print OUTPUT pack("V", ($offset-$header_size)>>9); - -# Set the partition type -if ( $opt{'F'} ) { - if ( $c > 1024 ) { - $fstype = 0x0c; # FAT32 LBA - } else { - $fstype = 0x0b; - } -} else { - if ( $c > 1024 ) { - $fstype = 0x0e; # FAT16 LBA - } elsif ( $psize > 65536 ) { - $fstype = 0x06; # FAT16 > 32MB - } else { - $fstype = 0x04; # FAT16 <= 32MB - } - seek(OUTPUT, $offset + 0x36, 0); - read(OUTPUT, $fsname, 8); - - # FAT12: adjust partition type - if ( $fsname eq 'FAT12 ' ) { - $fstype = 0x01; # FAT12 - } -} -seek(OUTPUT, $pstart+4, 0); -print OUTPUT pack("C", $fstype); - -flush OUTPUT; - -# Just in case this is a block device, try to flush the partition table -if ( $is_linux ) { - ioctl(OUTPUT, $BLKRRPART, 0); -}; - -exit 0; -__END__ -fa 31 c0 8e d8 8e d0 bc 0 7c 89 e6 6 57 52 8e c0 fb fc bf 0 6 b9 0 1 f3 a5 ea 20 6 0 0 52 b4 41 bb aa -55 31 c9 30 f6 f9 cd 13 72 13 81 fb 55 aa 75 d d1 e9 73 9 66 c7 6 8d 6 b4 42 eb 15 5a b4 8 cd 13 83 e1 3f -51 f b6 c6 40 f7 e1 52 50 66 31 c0 66 99 e8 66 0 e8 21 1 4d 69 73 73 69 6e 67 20 6f 70 65 72 61 74 69 6e 67 -20 73 79 73 74 65 6d 2e d a 66 60 66 31 d2 bb 0 7c 66 52 66 50 6 53 6a 1 6a 10 89 e6 66 f7 36 f4 7b c0 e4 -6 88 e1 88 c5 92 f6 36 f8 7b 88 c6 8 e1 41 b8 1 2 8a 16 fa 7b cd 13 83 c4 10 66 61 c3 e8 c4 ff be be 7d bf -be 7 b9 20 0 f3 a5 c3 66 60 89 e5 bb be 7 b9 4 0 31 c0 53 51 f6 7 80 74 3 40 89 de 83 c3 10 e2 f3 48 74 -5b 79 39 59 5b 8a 47 4 3c f 74 6 24 7f 3c 5 75 22 66 8b 47 8 66 8b 56 14 66 1 d0 66 21 d2 75 3 66 89 c2 -e8 ac ff 72 3 e8 b6 ff 66 8b 46 1c e8 a0 ff 83 c3 10 e2 cc 66 61 c3 e8 62 0 4d 75 6c 74 69 70 6c 65 20 61 63 -74 69 76 65 20 70 61 72 74 69 74 69 6f 6e 73 2e d a 66 8b 44 8 66 3 46 1c 66 89 44 8 e8 30 ff 72 13 81 3e -fe 7d 55 aa f 85 6 ff bc fa 7b 5a 5f 7 fa ff e4 e8 1e 0 4f 70 65 72 61 74 69 6e 67 20 73 79 73 74 65 6d 20 -6c 6f 61 64 20 65 72 72 6f 72 2e d a 5e ac b4 e 8a 3e 62 4 b3 7 cd 10 3c a 75 f1 cd 18 f4 eb fd Файлы syslinux-3.61/mtools/syslinux и syslinux-3.61-new/mtools/syslinux различаются diff -uNr syslinux-3.61/parseconfig.inc syslinux-3.61-new/parseconfig.inc --- syslinux-3.61/parseconfig.inc 2008-02-04 07:58:51 +0300 +++ syslinux-3.61-new/parseconfig.inc 2008-02-13 21:58:16 +0300 @@ -81,7 +81,7 @@ ; ; "localboot" command (PXELINUX, ISOLINUX) ; -%if IS_PXELINUX || IS_ISOLINUX +%if IS_PXELINUX || IS_ISOLINUX || IS_SYSLINUX pc_localboot: call getint cmp byte [VKernel],0 ; ("label" section only) je .err @@ -275,6 +275,25 @@ mov [SerialPort], word 0 ret +%ifdef WITH_GFX +%if IS_SYSLINUX +; +; like pc_setint16, but patch sector read funtion, too +; +pc_disksize: + push ax + call getint + pop si + jc .err + mov [si],bx + mov word [getlinsec.patch+1], getlinsec3 - getlinsec.patch - 3 + or bx,bx + jz .err + call cache_metadata +.err: ret +%endif +%endif + ; ; "F"-key command ; Файлы syslinux-3.61/pxelinux.0 и syslinux-3.61-new/pxelinux.0 различаются diff -uNr syslinux-3.61/pxelinux.asm syslinux-3.61-new/pxelinux.asm --- syslinux-3.61/pxelinux.asm 2008-02-04 07:58:51 +0300 +++ syslinux-3.61-new/pxelinux.asm 2008-02-13 21:58:16 +0300 @@ -868,6 +868,9 @@ ; AX contains the appropriate return code. ; local_boot: +%ifdef WITH_GFX + call gfx_done +%endif push cs pop ds mov [LocalBootType],ax diff -uNr syslinux-3.61/README.gfxboot syslinux-3.61-new/README.gfxboot --- syslinux-3.61/README.gfxboot 1970-01-01 03:00:00 +0300 +++ syslinux-3.61-new/README.gfxboot 2008-02-13 21:58:16 +0300 @@ -0,0 +1,41 @@ +Graphical boot screen +===================== + + syslinux/isolinux support a graphical boot screen using VESA BIOS + extensions. (Note that this is different from the graphics support that + syslinux comes with). + + To use it you have to prepare a special boot logo file and put a line like + this into syslinux.cfg/isolinux.cfg: + + gfxboot foo + + The tools to create 'foo' from the above example are in the gfxboot + package. Please _do_ have a look at its documentation before you begin. + + Note that you cannot use comboot images and graphics at the same time as + the memory used overlaps the comboot loading area. + + If you encouter problems with the graphics code, hold down SHIFT while + syslinux starts. This will put it into 'failsafe' mode that lets you + interactively skip critical parts (like monitor detection). + + + +Spread boot images over several floppy disks (syslinux) +======================================================= + + You can prepare boot disks with a file system that spans several disks. + The 'mkbootdisk' script from the openSUSE project can create a suitable + file system. + + syslinux will ask you for disk changes if necessary. To enable this + feature, use + + disksize + + Note that every individual disk must have at least a valid FAT boot + sector. syslinux will use the serial number stored there to verify that + the correct disk has been inserted (its last hex digit is the zero based + disk number). + diff -uNr syslinux-3.61/rllpack.inc syslinux-3.61-new/rllpack.inc --- syslinux-3.61/rllpack.inc 2008-02-04 07:58:51 +0300 +++ syslinux-3.61-new/rllpack.inc 2008-02-13 21:58:16 +0300 @@ -28,7 +28,7 @@ ; ; rllpack: ; Pack CX bytes from DS:SI into ES:DI -; Returns updated SI, DI and CX = number of bytes output +; Returns updated SI, DI and DX = number of bytes output ; rllpack: push ax diff -uNr syslinux-3.61/runkernel.inc syslinux-3.61-new/runkernel.inc --- syslinux-3.61/runkernel.inc 2008-02-04 07:58:51 +0300 +++ syslinux-3.61-new/runkernel.inc 2008-02-13 21:58:16 +0300 @@ -202,6 +202,15 @@ pop ds sub si,cmd_line_here mov [CmdLineLen],si ; Length including final null + +%ifdef WITH_GFX + mov eax,[KernelSects] + mov esi,ds + shl esi,4 + add esi,KernelCName + call gfx_progress_init +%endif + ; ; Now check if we have a large kernel, which needs to be loaded high ; @@ -308,6 +317,19 @@ jz nk_noinitrd call parse_load_initrd nk_noinitrd: + +%ifdef WITH_GFX + call gfx_progress_done + + cmp byte [gfx_cd_changed],0 + jz .no_cd_change + mov al,6 + xor si,si + xor di,di + call gfx_infobox +.no_cd_change: +%endif + ; ; Abandon hope, ye that enter here! We do no longer permit aborts. ; @@ -316,6 +338,10 @@ mov si,ready_msg call cwritestr +%ifdef WITH_GFX + call gfx_done +%endif + call vgaclearmode ; We can't trust ourselves after this UNLOAD_PREP ; Module-specific hook @@ -548,6 +574,34 @@ .got_start: push si + +%ifdef WITH_GFX + cmp byte [si],'+' + jnz .got_start_10 + mov byte [cs:gfx_cd_changed],1 + inc si + push es + push ds + push si + push cs + pop es + mov cx,100h + mov di,trackbuf + push di + rep movsb + mov byte [es:di],0 + pop si + xor di,di + mov al,5 ; ask for cd change + push cs + pop ds + call gfx_infobox + pop si + pop ds + pop es +.got_start_10: +%endif + mov di,InitRD ; Target buffer for mangled name call mangle_name call loadinitrd @@ -641,6 +695,20 @@ ret .notthere: + +%ifdef WITH_GFX + cmp byte [gfx_ok],0 + jz .nogfx + mov si,InitRDCName + xor di,di + mov al,2 + call gfx_infobox + call gfx_progress_done + mov si,no_msg + jmp abort_load +.nogfx: +%endif + mov si,err_noinitrd call cwritestr mov si,InitRDCName @@ -649,6 +717,20 @@ jmp abort_load no_high_mem: ; Error routine + + %ifdef WITH_GFX + cmp byte [gfx_ok],0 + jz .nogfx + mov si,err_nohighmem + xor di,di + mov al,0 + call gfx_infobox + call gfx_progress_done + mov si,no_msg + jmp abort_load + .nogfx: + %endif + mov si,err_nohighmem jmp abort_load Файлы syslinux-3.61/sample/c32echo.c32 и syslinux-3.61-new/sample/c32echo.c32 различаются Файлы syslinux-3.61/sample/comecho.com и syslinux-3.61-new/sample/comecho.com различаются Файлы syslinux-3.61/sample/fd.c32 и syslinux-3.61-new/sample/fd.c32 различаются Файлы syslinux-3.61/sample/filetest.c32 и syslinux-3.61-new/sample/filetest.c32 различаются Файлы syslinux-3.61/sample/hello2.c32 и syslinux-3.61-new/sample/hello2.c32 различаются Файлы syslinux-3.61/sample/hello.c32 и syslinux-3.61-new/sample/hello.c32 различаются Файлы syslinux-3.61/sample/syslogo.lss и syslinux-3.61-new/sample/syslogo.lss различаются diff -uNr syslinux-3.61/syslinux-3.51.log syslinux-3.61-new/syslinux-3.51.log --- syslinux-3.61/syslinux-3.51.log 1970-01-01 03:00:00 +0300 +++ syslinux-3.61-new/syslinux-3.51.log 2008-02-13 21:58:16 +0300 @@ -0,0 +1,110 @@ +Выполняется(%prep): /bin/sh -e /home/writer/RPM/tmp/rpm-tmp.81393 ++ umask 022 ++ /bin/mkdir -p /home/writer/RPM/BUILD ++ cd /home/writer/RPM/BUILD ++ cd /home/writer/RPM/BUILD ++ rm -rf syslinux-3.51 ++ echo 'Source #0 (syslinux-3.51.tar.bz2):' +Source #0 (syslinux-3.51.tar.bz2): ++ /bin/bzip2 -dc /home/writer/RPM/SOURCES/syslinux-3.51.tar.bz2 ++ /bin/tar -xf - ++ cd syslinux-3.51 ++ echo 'Source #1 (syslinux-gnu.tar.bz2):' +Source #1 (syslinux-gnu.tar.bz2): ++ /bin/bzip2 -dc /home/writer/RPM/SOURCES/syslinux-gnu.tar.bz2 ++ /bin/tar -xf - ++ echo 'Source #3 (syslinux-example-2.35.tar.bz2):' +Source #3 (syslinux-example-2.35.tar.bz2): ++ /bin/bzip2 -dc /home/writer/RPM/SOURCES/syslinux-example-2.35.tar.bz2 ++ /bin/tar -xf - ++ /bin/chmod -Rf u+rwX,go-w . ++ echo 'Patch #0 (syslinux-3.51.i386.patch):' +Patch #0 (syslinux-3.51.i386.patch): ++ /usr/bin/patch -p1 +patching file com32/lib/MCONFIG +patching file com32/libutil/Makefile +patching file com32/modules/Makefile +patching file com32/samples/Makefile +patching file dos/Makefile +patching file mbr/Makefile +patching file memdisk/Makefile +patching file menu/Makefile +patching file sample/Makefile ++ echo 'Patch #1 (syslinux-3.51-gfxboot.patch):' +Patch #1 (syslinux-3.51-gfxboot.patch): ++ /usr/bin/patch -p1 +patching file abort.inc +patching file add_crc +patching file com32/libutil/get_key.c +patching file com32/modules/cpuid.c +patching file com32/samples/keytest.c +patching file conio.inc +patching file gfxboot.inc +patching file isolinux.asm +Hunk #2 succeeded at 75 (offset 1 line). +Hunk #3 succeeded at 272 (offset 1 line). +Hunk #4 succeeded at 311 (offset 1 line). +Hunk #5 succeeded at 334 (offset 1 line). +Hunk #6 succeeded at 460 (offset 1 line). +Hunk #7 succeeded at 646 (offset 1 line). +Hunk #8 succeeded at 706 (offset 1 line). +Hunk #9 succeeded at 743 (offset 1 line). +Hunk #10 succeeded at 856 (offset 1 line). +Hunk #11 succeeded at 918 (offset 1 line). +Hunk #12 succeeded at 979 (offset -10 lines). +Hunk #13 succeeded at 1007 (offset -10 lines). +Hunk #14 succeeded at 1036 (offset -10 lines). +Hunk #15 succeeded at 1221 (offset -6 lines). +Hunk #16 succeeded at 1241 (offset -6 lines). +Hunk #17 succeeded at 1622 (offset 9 lines). +Hunk #18 succeeded at 1646 (offset 9 lines). +Hunk #19 FAILED at 1672. +1 out of 19 hunks FAILED -- saving rejects to file isolinux.asm.rej +patching file keywords +Hunk #1 succeeded at 42 (offset 9 lines). +patching file keywords.inc +Hunk #1 succeeded at 90 (offset 11 lines). +patching file layout.inc +Hunk #1 FAILED at 26. +1 out of 1 hunk FAILED -- saving rejects to file layout.inc.rej +patching file ldlinux.asm +Hunk #2 succeeded at 86 (offset 1 line). +Hunk #3 succeeded at 372 (offset 1 line). +Hunk #4 succeeded at 949 (offset 11 lines). +Hunk #5 succeeded at 1217 with fuzz 1 (offset 22 lines). +Hunk #6 succeeded at 1629 (offset 32 lines). +Hunk #7 succeeded at 1653 (offset 32 lines). +Hunk #8 succeeded at 1664 (offset 32 lines). +patching file loadhigh.inc +patching file Makefile +Hunk #1 FAILED at 135. +Hunk #2 FAILED at 145. +2 out of 2 hunks FAILED -- saving rejects to file Makefile.rej +patching file parseconfig.inc +Hunk #2 succeeded at 275 (offset 13 lines). +patching file pxelinux.asm +Hunk #1 succeeded at 877 (offset -22 lines). +patching file README.gfxboot +patching file rllpack.inc +patching file runkernel.inc +Hunk #2 succeeded at 317 (offset 9 lines). +Hunk #3 succeeded at 338 (offset 9 lines). +Hunk #4 succeeded at 582 (offset 35 lines). +Hunk #5 succeeded at 697 (offset 35 lines). +Hunk #6 FAILED at 719. +1 out of 6 hunks FAILED -- saving rejects to file runkernel.inc.rej +patching file syslinux.doc +Hunk #1 succeeded at 216 (offset 20 lines). +Hunk #2 succeeded at 230 (offset 20 lines). +patching file ui.inc +Hunk #1 FAILED at 15. +Hunk #2 succeeded at 36 (offset 2 lines). +Hunk #3 succeeded at 324 (offset 43 lines). +Hunk #4 succeeded at 356 with fuzz 2 (offset 46 lines). +Hunk #5 succeeded at 434 (offset 49 lines). +1 out of 5 hunks FAILED -- saving rejects to file ui.inc.rej +ошибка: Неверный код возврата из /home/writer/RPM/tmp/rpm-tmp.81393 (%prep) + + +Ошибки сборки пакетов: + Неверный код возврата из /home/writer/RPM/tmp/rpm-tmp.81393 (%prep) diff -uNr syslinux-3.61/ui.inc syslinux-3.61-new/ui.inc --- syslinux-3.61/ui.inc 2008-02-04 07:58:51 +0300 +++ syslinux-3.61-new/ui.inc 2008-02-13 21:58:16 +0300 @@ -16,6 +16,12 @@ load_config_file: call parse_config ; Parse configuration file no_config_file: + +%ifdef WITH_GFX + ; build gfx menu + call gfx_setup_menu +%endif + call adv_init ; @@ -57,6 +63,21 @@ cmp word [NoEscape],0 ; If NOESCAPE, no prompt, jne auto_boot ; always run default cmd +%ifdef WITH_GFX + cmp byte [gfx_ok],0 + jz .nogfx + mov edi,ds + shl edi,4 + add edi,command_line + mov ecx,max_cmd_len + xor eax,eax + xchg eax,[KbdTimeout] ; only the first time + call gfx_input + cmp ax,1 + jnz load_kernel +.nogfx: +%endif + mov si,boot_prompt call cwritestr @@ -330,9 +351,21 @@ push word real_mode_seg pop es mov di,cmd_line_here + +%ifdef WITH_GFX + ; gfx code includes them + cmp byte [gfx_ok],0 + jnz .isgfx +%endif + mov si,VKernelBuf+vk_append mov cx,[VKernelBuf+vk_appendlen] rep movsb + +%ifdef WITH_GFX +.isgfx: +%endif + mov [CmdLinePtr],di ; Where to add rest of cmd pop es mov di,KernelName @@ -350,7 +383,7 @@ mov al, [VKernelBuf+vk_type] mov [KernelType], al -%if IS_PXELINUX || IS_ISOLINUX +%if IS_PXELINUX || IS_ISOLINUX || IS_SYSLINUX ; Is this a "localboot" pseudo-kernel? %if IS_PXELINUX cmp byte [VKernelBuf+vk_rname+4], 0 @@ -428,6 +461,19 @@ push di call unmangle_name ; Get human form mov si,err_notfound ; Complain about missing kernel + +%ifdef WITH_GFX + cmp byte [gfx_ok],0 + jz .nogfx + pop si + xor di,di + mov al,2 + call gfx_infobox + mov si,no_msg + jmp abort_load +.nogfx: +%endif + call cwritestr pop si ; KernelCName call cwritestr Файлы syslinux-3.61/unix/syslinux и syslinux-3.61-new/unix/syslinux различаются Файлы syslinux-3.61/unix/syslinux-nomtools и syslinux-3.61-new/unix/syslinux-nomtools различаются