fs.h: A slighly more useful default PATH
[syslinux/sherbszt.git] / core / comboot.inc
blob83f0c030535aa0207a6f638c1d74899c76139dad
1 ;; -----------------------------------------------------------------------
2 ;;
3 ;;   Copyright 1994-2009 H. Peter Anvin - All Rights Reserved
4 ;;   Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
5 ;;
6 ;;   This program is free software; you can redistribute it and/or modify
7 ;;   it under the terms of the GNU General Public License as published by
8 ;;   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
9 ;;   Boston MA 02111-1307, USA; either version 2 of the License, or
10 ;;   (at your option) any later version; incorporated herein by reference.
12 ;; -----------------------------------------------------------------------
15 ;; comboot.inc
17 ;; Common code for running a COMBOOT image
19                 section .text16
21 ; Parameter registers definition; this is the definition
22 ; of the stack frame used by INT 21h and INT 22h.
23 %define         P_FLAGS         word [bp+44]
24 %define         P_FLAGSL        byte [bp+44]
25 %define         P_FLAGSH        byte [bp+45]
26 %define         P_CS            word [bp+42]
27 %define         P_IP            word [bp+40]
28 %define         P_CSIP          dword [bp+40]
29 %define         P_DS            word [bp+38]
30 %define         P_ES            word [bp+36]
31 %define         P_FS            word [bp+34]
32 %define         P_GS            word [bp+32]
33 %define         P_EAX           dword [bp+28]
34 %define         P_AX            word [bp+28]
35 %define         P_HAX           word [bp+30]
36 %define         P_AL            byte [bp+28]
37 %define         P_AH            byte [bp+29]
38 %define         P_ECX           dword [bp+24]
39 %define         P_CX            word [bp+24]
40 %define         P_HCX           word [bp+26]
41 %define         P_CL            byte [bp+24]
42 %define         P_CH            byte [bp+25]
43 %define         P_EDX           dword [bp+20]
44 %define         P_DX            word [bp+20]
45 %define         P_HDX           word [bp+22]
46 %define         P_DL            byte [bp+20]
47 %define         P_DH            byte [bp+21]
48 %define         P_EBX           dword [bp+16]
49 %define         P_BX            word [bp+16]
50 %define         P_HBX           word [bp+18]
51 %define         P_BL            byte [bp+16]
52 %define         P_BH            byte [bp+17]
53 %define         P_EBP           dword [bp+8]
54 %define         P_BP            word [bp+8]
55 %define         P_HBP           word [bp+10]
56 %define         P_ESI           dword [bp+4]
57 %define         P_SI            word [bp+4]
58 %define         P_HSI           word [bp+6]
59 %define         P_EDI           dword [bp]
60 %define         P_DI            word [bp]
61 %define         P_HDI           word [bp+2]
64 ; Set up the COMBOOT API interrupt vectors.  This is now done at
65 ; initialization time.
67 comboot_setup_api:
68                 mov di,DOSErrTramp      ; Error trampolines
69                 mov cx,32
70                 push cx
71                 mov eax,02EB206Ah       ; push 20h; jmp $+4
72 .loop1:         stosd
73                 inc ah
74                 loop .loop1
75                 dec di
76                 mov byte [di-1],0E9h
77                 mov ax,comboot_bogus-2
78                 sub ax,di
79                 stosw
81                 pop cx                  ; CX <- 32
82                 mov si,4*20h            ; DOS interrupt vectors
83                 mov bx,comboot_vectors
84                 mov di,DOSSaveVectors
85 .loop2:
86                 movsd
87                 movzx eax,word [bx]
88                 inc bx
89                 inc bx
90                 mov [si-4],eax
91                 loop .loop2
92                 ret
95 ; Restore the original state of the COMBOOT API vectors, and free
96 ; any low memory allocated by the comboot module.
98                 global comboot_cleanup_api
99 comboot_cleanup_api:
100                 pusha
101                 mov si,DOSSaveVectors
102                 mov di,4*20h
103                 mov cx,20h
104                 rep movsd               ; Restore DOS-range vectors
105                 popa
106                 ret
108                 section .bss16
109                 alignb 4
110 DOSSaveVectors  resd 32
112                 section .data16
113 %define comboot_err(x) (DOSErrTramp+4*((x)-20h))
115 comboot_vectors:
116                 dw comboot_return       ; INT 20 = exit
117                 dw comboot_int21        ; INT 21 = DOS-compatible system calls
118                 dw comboot_int22        ; INT 22 = native system calls
119                 dw comboot_err(23h)     ; INT 23 = DOS Ctrl-C handler
120                 dw comboot_err(24h)     ; INT 24 = DOS critical error handler
121                 dw comboot_err(25h)     ; INT 25 = DOS absolute disk read
122                 dw comboot_err(26h)     ; INT 26 = DOS absolute disk write
123                 dw comboot_err(27h)     ; INT 27 = DOS TSR
124                 dw comboot_int28        ; INT 28 = DOS idle interrupt
125                 dw comboot_int29        ; INT 29 = DOS fast console output
126                 dw comboot_err(2Ah)     ; INT 2A = DOS network API (NetBIOS)
127                 dw comboot_err(2Bh)     ; INT 2B = DOS reserved
128                 dw comboot_err(2Ch)     ; INT 2C = DOS reserved
129                 dw comboot_iret         ; INT 2D = DOS reserved, AMIS
130                 dw comboot_err(2Eh)     ; INT 2E = DOS run command
131                 dw comboot_iret         ; INT 2F = DOS multiplex interrupt
132                 dw comboot_err(30h)     ; INT 30 = DOS CP/M system calls
133                 dw comboot_err(31h)     ; INT 31 = DPMI
134                 dw comboot_err(32h)     ; INT 32 = DOS reserved
135                 dw comboot_iret         ; INT 33 = DOS mouse API
136                 dw comboot_err(34h)     ; INT 34 = DOS FPU emulation
137                 dw comboot_err(35h)     ; INT 35 = DOS FPU emulation
138                 dw comboot_err(36h)     ; INT 36 = DOS FPU emulation
139                 dw comboot_err(37h)     ; INT 37 = DOS FPU emulation
140                 dw comboot_err(38h)     ; INT 38 = DOS FPU emulation
141                 dw comboot_err(39h)     ; INT 39 = DOS FPU emulation
142                 dw comboot_err(3Ah)     ; INT 3A = DOS FPU emulation
143                 dw comboot_err(3Bh)     ; INT 3B = DOS FPU emulation
144                 dw comboot_err(3Ch)     ; INT 3C = DOS FPU emulation
145                 dw comboot_err(3Dh)     ; INT 3D = DOS FPU emulation
146                 dw comboot_err(3Eh)     ; INT 3E = DOS FPU emulation
147                 dw comboot_err(3Fh)     ; INT 3F = DOS overlay manager
149                 section .text16
151 ; INT 21h: generic DOS system call
152 comboot_int21:  sti
153                 push ds
154                 push es
155                 push fs
156                 push gs
157                 pushad
158                 cld
159                 mov bp,cs
160                 mov ds,bp
161                 mov es,bp
162                 mov bp,sp                       ; Set up stack frame
164                 pm_call pm_adjust_screen        ; The COMBOOT program might hav changed the screen
166                 mov cx,int21_count
167                 mov si,int21_table
168 .again:         lodsb
169                 cmp al,P_AH
170                 lodsw
171                 loopne .again
172                 ; The last function in the list is the
173                 ; "no such function" function
174                 clc
175                 call ax                 ; Call the invoked function
176 comboot_resume:
177                 mov bp,sp               ; In case the function clobbers BP
178                 setc P_FLAGSL           ; Propagate CF->error
179                 popad
180                 pop gs
181                 pop fs
182                 pop es
183                 pop ds
184 comboot_iret:
185                 iret
187 comboot_bad_int21:
188                 mov ax,P_AX
189                 push P_CSIP
190                 push 21h
191                 ; Fall through
193 ; Attempted to execute invalid DOS system call
194 ; The interrupt number is on the stack.
195 comboot_bogus:  pop dx                  ; Interrupt number
196                 pop edi                 ; CS:IP
197                 mov cx,err_notdos
198                 push comboot_bogus_tail
199                 jmp comboot_exit_msg
200 comboot_bogus_tail:
201                 xchg ax,dx
202                 pm_call pm_writehex2            ; Interrupt number
203                 mov al,' '
204                 pm_call pm_writechr
205                 xchg ax,dx
206                 pm_call pm_writehex4            ; Function number (AX)
207                 mov al,' '
208                 pm_call pm_writechr
209                 mov eax,edi
210                 pm_call pm_writehex8            ; CS:IP of the origin
211                 pm_call crlf
212                 jmp kaboom
214 ; Proper return vector
215 ; Note: this gets invoked both via INT 21h and directly via INT 20h.
216 ; We don't need to cld explicitly here, because comboot_exit does that
217 ; when invoking RESET_STACK_AND_SEGS.
218 comboot_return:
219                 cli                     ; May not have a safe stack
220                 push enter_command      ; Normal return to command prompt
221                 ; jmp comboot_exit
224 ; Generic COMBOOT return to command line code
225 ;  stack -> where to go next
226 ;     CX -> message (for _msg version)
228                 extern comboot_cleanup_lowmem
229 comboot_exit:
230                 xor cx,cx
231 comboot_exit_msg:
232                 pop bx                  ; Return address
233                 RESET_STACK_AND_SEGS si ; Contains sti, cld
234                 pm_call comboot_cleanup_lowmem
235                 pm_call pm_adjust_screen; The COMBOOT program might have change the screen
236                 jcxz .nomsg
237                 mov si,KernelName
238                 pm_call pm_writestr
239                 mov si,cx
240                 pm_call pm_writestr
241 .nomsg:
242                 jmp bx
245 ; INT 21h system calls
247 comboot_getkey:                         ; 01 = get key with echo
248                 pm_call vgashowcursor
249                 call comboot_getchar
250                 pm_call vgahidecursor
251                 pm_call pm_writechr
252                 clc
253                 ret
255 comboot_writechr:                       ; 02 = writechr
256                 mov al,P_DL
257                 pm_call pm_writechr
258                 clc
259                 ret
261 comboot_writeserial:                    ; 04 = write serial port
262                 mov al,P_DL
263                 pm_call pm_write_serial
264                 clc
265                 ret
267 comboot_getkeynoecho:                   ; 08 = get key w/o echo
268                 call comboot_getchar
269                 clc
270                 ret
272 comboot_writestr:                       ; 09 = write DOS string
273                 mov es,P_DS
274                 mov si,P_DX
275 .loop:          es lodsb
276                 cmp al,'$'              ; End string with $ - bizarre
277                 je .done
278                 pm_call pm_writechr
279                 jmp short .loop
280 .done:          clc
281                 ret
283 comboot_checkkey:                       ; 0B = check keyboard status
284                 cmp byte [APIKeyFlag],00h
285                 jnz .waiting
286                 pm_call pm_pollchar
287 .waiting:       setz al
288                 dec al                  ; AL = 0FFh if present, 0 if not
289                 mov P_AL,al
290                 clc
291                 ret
293 comboot_checkver:                       ; 30 = check DOS version
294                 ; We return 0 in all DOS-compatible version registers,
295                 ; but the high part of eax-ebx-ecx-edx spell "SYSLINUX"
296                 mov P_EAX,'SY' << 16
297                 mov P_EBX,'SL' << 16
298                 mov P_ECX,'IN' << 16
299                 mov P_EDX,'UX' << 16
300                 ret
302 comboot_getchar:
303                 cmp byte [APIKeyFlag],00h
304                 jne .queued
305                 pm_call pm_getchar      ; If not queued get input
306                 and al,al               ; Function key?  (CF <- 0)
307                 jnz .done
308                 mov [APIKeyWait],ah     ; High part of key
309                 inc byte [APIKeyFlag]   ; Set flag
310 .done:          mov P_AL,al
311                 ret
312 .queued:        mov al,[APIKeyWait]
313                 dec byte [APIKeyFlag]
314                 jmp .done
317 ; INT 28h - DOS idle
319 comboot_int28:
320                 sti
321                 cld
322                 call do_idle
323                 iret
326 ; INT 29h - DOS fast write character
328 comboot_int29:
329                 sti
330                 cld
331                 pm_call pm_writechr
332                 iret
335 ; INT 22h - SYSLINUX-specific system calls
336 ;           System call number in ax
338 comboot_int22:
339                 sti
340                 push ds
341                 push es
342                 push fs
343                 push gs
344                 pushad
345                 cld
346                 mov bp,cs
347                 mov ds,bp
348                 mov es,bp
349                 mov bp,sp                       ; Set up stack frame
351                 pm_call pm_adjust_screen        ; The COMBOOT program might hav changed the screen
353                 cmp ax,int22_count
354                 jb .ok
355                 xor ax,ax                       ; Function 0 -> unimplemented
356 .ok:
357                 xchg ax,bx
358                 add bx,bx                       ; CF <- 0
359                 call [bx+int22_table]
360                 jmp comboot_resume              ; On return
363 ; INT 22h AX=0000h      Unimplemented call
365 comapi_err:
366                 stc
367                 ret
370 ; INT 22h AX=0001h      Get SYSLINUX version
372 comapi_get_version:
373                 ; Number of API functions supported
374                 mov P_AX,int22_count
375                 ; SYSLINUX version
376                 mov P_CX,(VERSION_MAJOR << 8)+VERSION_MINOR
377                 ; SYSLINUX derivative ID byte
378                 mov P_DX,my_id
379                 ; For future use
380                 mov P_BX,cs     ; cs == 0
382                 mov P_ES,ds
383                 ; ES:SI -> version banner
384                 mov P_SI,syslinux_banner + 2    ; Skip leading CR LF
385                 ; ES:DI -> copyright string
386                 mov P_DI,copyright_str + 1      ; Skip leading space
388 comapi_nop:
389                 clc
390                 ret
393 ; INT 22h AX=0002h      Write string
395 ; Write null-terminated string in ES:BX
397 comapi_writestr:
398                 mov ds,P_ES
399                 mov si,P_BX
400                 pm_call pm_writestr
401                 clc
402                 ret
405 ; INT 22h AX=0003h      Run command
407 ; Terminates the COMBOOT program and executes the command line in
408 ; ES:BX as if it had been entered by the user.
410 comapi_run:
411                 mov es,P_ES
412                 mov bx,P_BX
413                 pm_call pm_env32_run
414                 ret
417 ; INT 22h AX=0004h      Run default command
419 ; Terminates the COMBOOT program and executes the default command line
420 ; as if a timeout had happened or the user pressed <Enter>.
422 comapi_run_default:
423                 push auto_boot
424                 jmp comboot_exit
427 ; INT 22h AX=0005h      Force text mode
429 ; Puts the video in standard text mode
431 comapi_textmode:
432                 pm_call vgaclearmode
433                 clc
434                 ret
437 ; INT 22h AX=0006h      Open file
439 comapi_open:
440                 mov es,P_ES
441                 mov si,P_SI
442                 pm_call pm_open_file
443                 mov P_EAX,eax
444                 mov P_CX,cx
445                 mov P_SI,si
446                 ret
449 ; INT 22h AX=0007h      Read file
451 comapi_read:
452                 mov es,P_ES
453                 mov bx,P_BX
454                 mov si,P_SI
455                 mov cx,P_CX
456                 pm_call getfssec
457                 jnc .noteof
458                 xor si,si               ; SI <- 0 on EOF, CF <- 0
459 .noteof:        mov P_SI,si
460                 mov P_ECX,ecx
461                 ret
464 ; INT 22h AX=0008h      Close file
466 comapi_close:
467                 mov si,P_SI
468                 pm_call pm_close_file
469                 clc
470                 ret
473 ; INT 22h AX=0009h      Call PXE stack
475 %if IS_PXELINUX
476 comapi_pxecall:
477                 mov bx,P_BX
478                 mov es,P_ES
479                 mov di,P_DI
480                 call pxenv
481                 mov ax,[PXEStatus]
482                 mov P_AX,ax
483                 ret
484 %else
485 comapi_pxecall  equ comapi_err                  ; Not available
486 %endif
489 ; INT 22h AX=000Ah      Get Derivative-Specific Info
491 comapi_derinfo:
492                 mov P_AL,my_id
493 %if IS_PXELINUX
494                 mov ax,[APIVer]
495                 mov P_DX,ax
496                 mov ax,[StrucPtr]
497                 mov P_BX,ax
498                 mov ax,[StrucPtr+2]
499                 mov P_ES,ax
500                 mov ax,[InitStack]
501                 mov P_SI,ax
502                 mov ax,[InitStack+2]
503                 mov P_FS,ax
504                 mov eax,[IPInfo.MyIP]
505                 mov P_ECX,eax
506                 mov P_GS,0
507                 mov P_DI,IPInfo
508 %else
509                 ; Physical medium...
511                 mov al,[SectorShift]
512                 mov P_CL,al
513                 mov al,[DriveNumber]
514                 mov P_DL,al
515                 mov P_FS,cs
516                 mov P_SI,OrigESDI
517                 mov P_GS,cs
518                 mov P_DI,Hidden
519 %if IS_SYSLINUX || IS_EXTLINUX
520                 mov P_ES,cs
521                 mov P_BX,PartInfo
522 %elif IS_ISOLINUX
523                 mov P_ES,cs
524                 mov P_BX,spec_packet
525                 mov ax,[BIOSType]
526                 sub ax,bios_cdrom
527                 shr ax,2
528                 mov P_CH,al             ; Mode (el torito/cbios/ebios)
529 %endif
530 %endif
531                 clc
532                 ret
535 ; INT 22h AX=000Bh      Get Serial Console Configuration
537 comapi_serialcfg:
538                 pm_call pm_serialcfg
539                 mov P_DX,ax
540                 mov P_CX,cx
541                 mov P_BX,bx
542                 clc
543                 ret
546 ; INT 22h AX=000Ch      Perform final cleanup
548 comapi_cleanup:
549 %if IS_PXELINUX
550                 ; Unload PXE if requested
551                 test dl,3
552                 setnz [KeepPXE]
553                 sub bp,sp               ; unload_pxe may move the stack around
554                 pm_call unload_pxe
555                 add bp,sp               ; restore frame pointer...
556 %elif IS_SYSLINUX || IS_EXTLINUX
557                 ; Restore original FDC table
558                 mov eax,[OrigFDCTabPtr]
559                 mov [fdctab],eax
560 %endif
561                 pm_call cleanup_hardware
562                 clc
563                 ret
566 ; INT 22h AX=000Dh      Clean up then replace bootstrap
568 comapi_chainboot:
569                 ret
572 ; INT 22h AX=000Eh      Get configuration file name
574 comapi_configfile:
575                 mov P_ES,cs
576                 mov P_BX,ConfigName
577                 clc
578                 ret
581 ; INT 22h AX=000Fh      Get IPAPPEND strings
583 comapi_ipappend:
584                 mov P_ES,cs
585                 mov P_CX,numIPAppends
586                 mov P_BX,IPAppends
587                 clc
588                 ret
591 ; INT 22h AX=0010h      Resolve hostname
593 %if IS_PXELINUX
594                 extern pm_pxe_dns_resolv
595 comapi_dnsresolv:
596                 mov ds,P_ES
597                 mov si,P_BX
598                 pm_call pm_pxe_dns_resolv
599                 mov P_EAX,eax
600                 clc
601                 ret
602 %else
603 comapi_dnsresolv equ comapi_err
604 %endif
606                 section .text16
609 ; INT 22h AX=0011h      Obsolete
613 ; INT 22h AX=0012h      Obsolete
617 ; INT 22h AX=0013h      Idle call
619 comapi_idle:
620                 call do_idle
621                 clc
622                 ret
625 ; INT 22h AX=0014h      Local boot
627 comapi_localboot:
628                 mov ax,P_DX
629                 pm_call pm_local_boot
630                 ret
633 ; INT 22h AX=0015h      Feature flags
635 comapi_features:
636                 mov P_ES,cs
637                 mov P_BX,feature_flags
638                 mov P_CX,feature_flags_len
639                 clc
640                 ret
643 ; INT 22h AX=0016h      Run kernel image
645 comapi_runkernel:
646                 ret
649 ; INT 22h AX=0017h  Report video mode change
651 comapi_usingvga:
652                 mov ax,P_BX
653                 cmp ax,0Fh              ; Unknown flags = failure
654                 ja .error
655                 mov cx,P_CX
656                 mov dx,P_DX
657                 pm_call pm_using_vga
658                 clc
659                 ret
660 .error:
661                 stc
662                 ret
665 ; INT 22h AX=0018h  Query custom font
667 comapi_userfont:
668                 mov al,[UserFont]
669                 and al,al
670                 jz .done
671                 mov al,[VGAFontSize]
672                 pm_call pm_userfont
673                 mov P_ES,es
674                 mov P_BX,bx
676 .done:          ; CF=0 here
677                 mov P_AL,al
678                 ret
681 ; INT 22h AX=0019h  Read disk
683 %if IS_SYSLINUX || IS_ISOLINUX || IS_EXTLINUX
684 comapi_readdisk:
685                 cmp P_EDI,0             ; Reserved for future expansion
686                 jnz .err
687                 mov eax,P_EDX
688                 mov edx,P_ESI
689                 mov es,P_ES
690                 mov bx,P_BX
691                 mov bp,P_CX             ; WE CANNOT use P_* after touching bp!
692                 call getlinsec
693                 clc
694                 ret
695 .err:
696                 stc
697                 ret
698 %else
699 comapi_readdisk equ comapi_err
700 %endif
703 ; INT 22h AX=001Ah      Obsolete
707 ; INT 22h AX=001Bh      Obsolete
711 ; INT 22h AX=001Ch      Get pointer to auxillary data vector
713 comapi_getadv:
714                 mov P_ES,ds
715                 mov P_BX,adv0.data
716                 mov P_CX,ADV_LEN
717                 ret
720 ; INT 22h AX=001Dh      Write auxillary data vector
722 comapi_writeadv equ adv_write
725 ; INT 22h AX=001Eh      Keyboard remapping table
726 comapi_kbdtable:
727                 cmp P_DX,0
728                 jne .err
729                 mov P_AX,1                      ; Version
730                 mov P_CX,256                    ; Length
731                 mov P_ES,cs
732                 mov P_BX,KbdMap
733                 ret
734 .err:
735                 stc
736                 ret
739 ; INT 22h AX=001Fh      Get current working directory
741 comapi_getcwd:
742                 mov P_ES,cs
743                 mov P_BX,CurrentDirName
744                 clc
745                 ret
748 ; INT 22h AX=0023h      Query shuffler size
750 comapi_shufsize:
751                 ; +15 is padding to guarantee alignment
752                 mov P_CX,__bcopyxx_len + 15
753                 ret
756 ; INT 22h AX=0024h      Cleanup, shuffle and boot raw
758 comapi_shufraw:
759                 call comapi_cleanup
760                 mov edi,P_EDI
761                 mov esi,P_ESI
762                 mov ecx,P_ECX
763                 jmp shuffle_and_boot_raw
766 ; INT 22h AX=0025h      Initialize the ADV structure
768 comapi_initadv:
769                 call adv_init
770                 ret
772                 section .data16
774 %macro          int21 2
775                 db %1
776                 dw %2
777 %endmacro
779 int21_table:
780                 int21   00h, comboot_return
781                 int21   01h, comboot_getkey
782                 int21   02h, comboot_writechr
783                 int21   04h, comboot_writeserial
784                 int21   08h, comboot_getkeynoecho
785                 int21   09h, comboot_writestr
786                 int21   0Bh, comboot_checkkey
787                 int21   30h, comboot_checkver
788                 int21   4Ch, comboot_return
789                 int21    -1, comboot_bad_int21
790 int21_count     equ ($-int21_table)/3
792                 alignz 2
793 int22_table:
794                 dw comapi_err           ; 0000 unimplemented syscall
795                 dw comapi_get_version   ; 0001 get SYSLINUX version
796                 dw comapi_writestr      ; 0002 write string
797                 dw comapi_run           ; 0003 run specified command
798                 dw comapi_run_default   ; 0004 run default command
799                 dw comapi_textmode      ; 0005 force text mode
800                 dw comapi_open          ; 0006 open file
801                 dw comapi_read          ; 0007 read file
802                 dw comapi_close         ; 0008 close file
803                 dw comapi_pxecall       ; 0009 call PXE stack
804                 dw comapi_derinfo       ; 000A derivative-specific info
805                 dw comapi_serialcfg     ; 000B get serial port config
806                 dw comapi_cleanup       ; 000C perform final cleanup
807                 dw comapi_err           ; 000D clean up then bootstrap
808                 dw comapi_configfile    ; 000E get name of config file
809                 dw comapi_ipappend      ; 000F get ipappend strings
810                 dw comapi_dnsresolv     ; 0010 resolve hostname
811                 dw comapi_err           ; 0011 maximum shuffle descriptors
812                 dw comapi_err           ; 0012 cleanup, shuffle and boot
813                 dw comapi_idle          ; 0013 idle call
814                 dw comapi_localboot     ; 0014 local boot
815                 dw comapi_features      ; 0015 feature flags
816                 dw comapi_runkernel     ; 0016 run kernel image
817                 dw comapi_usingvga      ; 0017 report video mode change
818                 dw comapi_userfont      ; 0018 query custom font
819                 dw comapi_readdisk      ; 0019 read disk
820                 dw comapi_err           ; 001A cleanup, shuffle and boot to pm
821                 dw comapi_err           ; 001B cleanup, shuffle and boot to rm
822                 dw comapi_getadv        ; 001C get pointer to ADV
823                 dw comapi_writeadv      ; 001D write ADV to disk
824                 dw comapi_kbdtable      ; 001E keyboard remapping table
825                 dw comapi_getcwd        ; 001F get current working directory
826                 dw comapi_err           ; 0020 open directory
827                 dw comapi_err           ; 0021 read directory
828                 dw comapi_err           ; 0022 close directory
829                 dw comapi_shufsize      ; 0023 query shuffler size
830                 dw comapi_shufraw       ; 0024 cleanup, shuffle and boot raw
831                 dw comapi_initadv       ; 0025 initialize adv structure
832 int22_count     equ ($-int22_table)/2
834 APIKeyWait      db 0
835 APIKeyFlag      db 0
837 zero_string     db 0                    ; Empty, null-terminated string
840 ; This is the feature flag array for INT 22h AX=0015h
842 ; Note: PXELINUX clears the idle is noop flag if appropriate
843 ; in pxe_detect_nic_type
845 feature_flags:
846                 db 1                    ; Have local boot, idle is not noop
847 feature_flags_len equ ($-feature_flags)
849 err_notdos      db ': attempted DOS system call INT ',0
850 err_comlarge    db 'COMBOOT image too large.', CR, LF, 0
852                 global VGAFontSize, UserFont
853                 alignz 2
854 VGAFontSize     dw 16                   ; Defaults to 16 byte font
855 UserFont        db 0                    ; Using a user-specified font
857                 section .bss16
858                 alignb 4
859 DOSErrTramp     resd    33              ; Error trampolines
861                 global ConfigName
862 ConfigName      resb    FILENAME_MAX
863 %ifndef HAVE_CURRENTDIRNAME
864                 global CurrentDirName
865 CurrentDirName  resb    FILENAME_MAX
866 %endif