section .text org 0x0 rom_start: db 0x55, 0xaa, 0x41 init: jmp near go_init nop times 17-4+$-init db 0x0 dw 0 ; we have no PCI ;) dw pnp_header db "(C) Rudolf Marek 2009, under GPL v2.0 " db "IBM BASIC option ROM loader. Catenate with original 32KB basic from 0xf6000 " db "to create 32KB+512B image. Fix its checksums using build_rom.c!",0 pnp_header: db "$PnP" db 0x1 ;struc rev len db (end_table - pnp_header) / 16 dw 0 ; offset to next db 0 ; padd checksum2: db 0 ; checksum2 devid dd 0 manuf dw ibm prod dw ibm_basic type db 0x80 db 0x0 db 0x0 flg db 0x14 ;rom only required if selected as boot device, indicate we can do IPL bcv dw 0x0 dv dw 0x0 bev dw go_bev res2 dw 0x0 res dw 0x0 end_table: go_init: and ax,0xcf or ax,0x20 ;see PnP spec 1.0A on pg 21 retf go_bev: cli xor ax,ax mov ss,ax mov sp,0xfffe ;setup temporary stack mov ax, cs add ax, 32 ;jump 32 bytes forward where the rom starts (512 bytes forward right after this loader push ax xor ax,ax push ax retf ;jump to original entrypoint with IP=0 ibm db "IBM",0 ibm_basic db "ROM BASIC",0 times 512-$+rom_start db 0xff