aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-12-06 10:13:41 +0000
committerMatt Fleming <matt.fleming@intel.com>2012-12-06 10:47:31 +0000
commitddb10ce99c327888ade4d2ba3e4c50ad12aaa059 (patch)
treeb9f0cbe427b4a4d8441857990fd4410ee4635676
parente4b3ce2dd82ce2da85c37fd3f332ec2eb802b734 (diff)
downloadsyslinux-ddb10ce99c327888ade4d2ba3e4c50ad12aaa059.tar.gz
syslinux-ddb10ce99c327888ade4d2ba3e4c50ad12aaa059.tar.xz
syslinux-ddb10ce99c327888ade4d2ba3e4c50ad12aaa059.zip
Delete 16-bit COMBOOT supportsyslinux-5.00
16-bit COMBOOT files are no longer supported by Syslinux in 5.00 so delete all references and change any 32-bit COMBOOT image references to mention ELF instead. Some of the COMBOOT stuff is still used internally so we can't nuke core/comboot.inc yet, but that will disappear in a future release. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r--Makefile4
-rw-r--r--NEWS3
-rw-r--r--README1
-rw-r--r--com32/elflink/ldlinux/execute.c1
-rw-r--r--com32/elflink/ldlinux/ldlinux.c2
-rw-r--r--com32/include/menu.h1
-rw-r--r--com32/include/syslinux/boot.h1
-rw-r--r--com32/sysdump/README2
-rw-r--r--core/comboot.inc47
-rw-r--r--doc/comboot.txt940
-rw-r--r--doc/extlinux.txt4
-rw-r--r--doc/mboot.txt2
-rw-r--r--doc/syslinux.txt30
-rw-r--r--man/syslinux.138
-rw-r--r--modules/Makefile61
-rw-r--r--modules/int18.asm16
-rw-r--r--modules/poweroff.asm102
-rw-r--r--modules/pxechain.asm558
-rw-r--r--modules/ver.asm606
-rw-r--r--modules/writestr.inc47
20 files changed, 23 insertions, 2443 deletions
diff --git a/Makefile b/Makefile
index ec8851ca..07a1dc32 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ include $(MAKEDIR)/syslinux.mk
# directories.
#
-MODULES = memdisk/memdisk memdump/memdump.com modules/*.com \
+MODULES = memdisk/memdisk memdump/memdump.com \
com32/menu/*.c32 com32/modules/*.c32 com32/mboot/*.c32 \
com32/hdt/*.c32 com32/rosh/*.c32 com32/gfxboot/*.c32 \
com32/sysdump/*.c32 com32/lua/src/*.c32 com32/chain/*.c32 \
@@ -57,7 +57,7 @@ BOBJECTS = $(BTARGET) \
# Note: libinstaller is both a BSUBDIR and an ISUBDIR. It contains
# files that depend only on the B phase, but may have to be regenerated
# for "make installer".
-BSUBDIRS = codepage com32 lzo core memdisk modules mbr memdump gpxe sample \
+BSUBDIRS = codepage com32 lzo core memdisk mbr memdump gpxe sample \
diag libinstaller dos win32 win64 dosutil
ITARGET =
IOBJECTS = $(ITARGET) \
diff --git a/NEWS b/NEWS
index 65e403fc..d872e21b 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,9 @@ Changes in 5.00:
* ldlinux: A new "PATH" directive was added to the ldlinux.c32
config parser that specifies a colon-separated list of
directories to search when attempting to load modules.
+ * ALL: Delete all references to/code for 16-bit COMBOOT files.
+ COMBOOT files (.cbt and .com) are no longer supported under
+ Syslinux.
Changes in 4.06:
* Support for NTFS, by Paulo Alcantara.
diff --git a/README b/README
index bb1aeb65..f00fd0f7 100644
--- a/README
+++ b/README
@@ -7,7 +7,6 @@ See the files in the doc directory for documentation about SYSLINUX:
extlinux.txt - Documentation specific to EXTLINUX.
menu.txt - About the menu systems.
usbkey.txt - About using SYSLINUX on USB keys.
- comboot.txt - About the extension API.
memdisk.txt - Documentation about MEMDISK.
Also see the files:
diff --git a/com32/elflink/ldlinux/execute.c b/com32/elflink/ldlinux/execute.c
index bfb26ffb..727df50a 100644
--- a/com32/elflink/ldlinux/execute.c
+++ b/com32/elflink/ldlinux/execute.c
@@ -39,7 +39,6 @@ const struct image_types image_boot_types[] = {
{ "bss", IMAGE_TYPE_BSS },
{ "pxe", IMAGE_TYPE_PXE },
{ "fdimage", IMAGE_TYPE_FDIMAGE },
- { "comboot", IMAGE_TYPE_COMBOOT },
{ "com32", IMAGE_TYPE_COM32 },
{ "config", IMAGE_TYPE_CONFIG },
{ NULL, 0 },
diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c
index 484ebe52..6f9f20fa 100644
--- a/com32/elflink/ldlinux/ldlinux.c
+++ b/com32/elflink/ldlinux/ldlinux.c
@@ -21,8 +21,6 @@ struct file_ext {
};
static const struct file_ext file_extensions[] = {
- { ".com", IMAGE_TYPE_COMBOOT },
- { ".cbt", IMAGE_TYPE_COMBOOT },
{ ".c32", IMAGE_TYPE_COM32 },
{ ".img", IMAGE_TYPE_FDIMAGE },
{ ".bss", IMAGE_TYPE_BSS },
diff --git a/com32/include/menu.h b/com32/include/menu.h
index 5a4c901e..bc0182f7 100644
--- a/com32/include/menu.h
+++ b/com32/include/menu.h
@@ -87,7 +87,6 @@ enum kernel_type {
KT_BSS, /* Boot sector with patch */
KT_PXE, /* PXE NBP */
KT_FDIMAGE, /* Floppy disk image */
- KT_COMBOOT, /* COMBOOT image */
KT_COM32, /* COM32 image */
KT_CONFIG, /* Configuration file */
};
diff --git a/com32/include/syslinux/boot.h b/com32/include/syslinux/boot.h
index aea32d9c..74a311df 100644
--- a/com32/include/syslinux/boot.h
+++ b/com32/include/syslinux/boot.h
@@ -61,7 +61,6 @@ extern const struct image_types image_boot_types[];
#define IMAGE_TYPE_BSS 3
#define IMAGE_TYPE_PXE 4
#define IMAGE_TYPE_FDIMAGE 5
-#define IMAGE_TYPE_COMBOOT 6
#define IMAGE_TYPE_COM32 7
#define IMAGE_TYPE_CONFIG 8
#define IMAGE_TYPE_LOCALBOOT 9
diff --git a/com32/sysdump/README b/com32/sysdump/README
index 2b825775..7d10e32b 100644
--- a/com32/sysdump/README
+++ b/com32/sysdump/README
@@ -1,4 +1,4 @@
-This is a very simple COMBOOT program which can be used to dump memory
+This is a very simple COM32 program which can be used to dump memory
regions over a serial port. To use it, type on the SYSLINUX command
line:
diff --git a/core/comboot.inc b/core/comboot.inc
index b11ae18d..e5afbe25 100644
--- a/core/comboot.inc
+++ b/core/comboot.inc
@@ -114,7 +114,7 @@ DOSSaveVectors resd 32
comboot_vectors:
dw comboot_return ; INT 20 = exit
- dw comboot_int21 ; INT 21 = DOS-compatible system calls
+ dw comboot_err(21h) ; INT 21 = DOS-compatible system calls
dw comboot_int22 ; INT 22 = native system calls
dw comboot_err(23h) ; INT 23 = DOS Ctrl-C handler
dw comboot_err(24h) ; INT 24 = DOS critical error handler
@@ -148,31 +148,6 @@ comboot_vectors:
section .text16
-; INT 21h: generic DOS system call
-comboot_int21: sti
- push ds
- push es
- push fs
- push gs
- pushad
- cld
- mov bp,cs
- mov ds,bp
- mov es,bp
- mov bp,sp ; Set up stack frame
-
- pm_call pm_adjust_screen ; The COMBOOT program might hav changed the screen
-
- mov cx,int21_count
- mov si,int21_table
-.again: lodsb
- cmp al,P_AH
- lodsw
- loopne .again
- ; The last function in the list is the
- ; "no such function" function
- clc
- call ax ; Call the invoked function
comboot_resume:
mov bp,sp ; In case the function clobbers BP
setc P_FLAGSL ; Propagate CF->error
@@ -212,7 +187,7 @@ comboot_bogus_tail:
jmp kaboom
; Proper return vector
-; Note: this gets invoked both via INT 21h and directly via INT 20h.
+; Note: this gets invoked directly via INT 20h.
; We don't need to cld explicitly here, because comboot_exit does that
; when invoking RESET_STACK_AND_SEGS.
comboot_return:
@@ -457,24 +432,6 @@ comapi_initadv:
section .data16
-%macro int21 2
- db %1
- dw %2
-%endmacro
-
-int21_table:
- int21 00h, comboot_return
- int21 01h, comboot_getkey
- int21 02h, comboot_writechr
- int21 04h, comboot_writeserial
- int21 08h, comboot_getkeynoecho
- int21 09h, comboot_writestr
- int21 0Bh, comboot_checkkey
- int21 30h, comboot_checkver
- int21 4Ch, comboot_return
- int21 -1, comboot_bad_int21
-int21_count equ ($-int21_table)/3
-
alignz 2
int22_table:
dw comapi_err ; 0000 unimplemented syscall
diff --git a/doc/comboot.txt b/doc/comboot.txt
deleted file mode 100644
index 6e9d7ab5..00000000
--- a/doc/comboot.txt
+++ /dev/null
@@ -1,940 +0,0 @@
-
- COMBOOT and COM32 files
-
-
-Syslinux supports simple standalone programs, using a file format
-similar to DOS ".com" files. A 32-bit version, called COM32, is also
-provided. A simple API provides access to a limited set of filesystem
-and console functions.
-
-
- ++++ COMBOOT file format ++++
-
-A COMBOOT file is a raw binary file containing 16-bit code. It should
-be linked to run at offset 0x100, and contain no absolute segment
-references. It is run in 16-bit real mode.
-
-A COMBOOT image can be written to be compatible with MS-DOS. Such a
-file will usually have extension ".com". A COMBOOT file which is not
-compatible with MS-DOS will usually have extension ".cbt".
-
-Before running the program, Syslinux sets up the following fields in
-the Program Segment Prefix (PSP), a structure at offset 0 in the
-program segment:
-
- Offset Size Meaning
- 0 word Contains an INT 20h instruction
- 2 word Contains the paragraph (16-byte "segment" address) at
- the end of memory available to the program.
- 128 byte Length of the command line arguments, including the leading
- space but not including the final CR character.
- 129 127b Command line arguments, starting with a space and ending
- with a CR character (ASCII 13).
-
-The program is allowed to use memory between the PSP paragraph (which
-all the CS, DS, ES and SS registers point to at program start) and the
-paragraph value given at offset 2.
-
-On startup, SP is set up to point to the end of the 64K segment, at
-0xfffe. Under DOS it is possible for SP to contain a smaller
-value if memory is very tight; this is never the case under Syslinux.
-
-The program should make no assumptions about what segment address it
-will be loaded at; instead it should look at the segment registers on
-program startup. Both DOS and Syslinux will guarantee CS == DS == ES
-== SS on program start; the program should not assume anything about
-the values of FS or GS.
-
-To exit, a program can either execute a near RET (which will jump to
-offset 0 which contains an INT 20h instruction, terminating the
-program), or execute INT 20h or INT 21h AH=00h or INT 21h AH=4Ch.
-If compatiblity with Syslinux 1.xx is desired, use INT 20h.
-
-
- ++++ COM32R file format ++++
-
-A COM32R file is a raw binary file containing 32-bit code. It should
-be self-relocating, as it will be loaded by the Syslinux core at any
-4K aligned address. It will be run in flat-memory 32-bit protected
-mode. Under Syslinux, it will be run in CPL 0, however, since it may
-be possible to create a COM32 execution engine that would run under
-something like Linux DOSEMU, it is recommended that the code does not
-assume CPL 0 unless absolutely necessary.
-
-A COM32R program must start with the byte sequence B8 FE 4C CD 21 (mov
-eax,21cd4cfeh) as a magic number.
-
-The COM32R format replaces the earlier COM32 format, which was linked
-to a fixed address (0x101000).
-
-A COM32R file should have extension ".c32".
-
-On startup, CS will be set up as a flat 32-bit code segment, and DS ==
-ES == SS will be set up as the equivalent flat 32-bit data segment.
-FS and GS are reserved for future use and are currently initialized to
-zero. A COM32R image should not assume any particular values of
-segment selectors.
-
-ESP is set up at the end of available memory and also serves as
-notification to the program how much memory is available.
-
-The following arguments are passed to the program on the stack:
-
- Address Size Meaning
- [ESP] dword Return (termination) address
- [ESP+4] dword Number of additional arguments (currently 8)
- [ESP+8] dword Pointer to the command line arguments (null-terminated string)
- [ESP+12] dword Pointer to INT call helper function
- [ESP+16] dword Pointer to low memory bounce buffer
- [ESP+20] dword Size of low memory bounce buffer
- [ESP+24] dword Pointer to FAR call helper function (new in 2.05)
- [ESP+28] dword Pointer to CDECL helper function (new in 3.54)
- [ESP+32] dword Amount of memory controlled by the Syslinux core (new in 3.74)
- [ESP+36] dword Pointer to the filename of the com32 module (new in 3.86)
- [ESP+40] dword Pointer to protected-mode functions (new in 4.00)
-
-The libcom32 startup code loads this into a structure named __com32,
-defined in <com32.h>:
-
-extern struct com32_sys_args {
- uint32_t cs_sysargs;
- char *cs_cmdline;
- void __cdecl(*cs_intcall)(uint8_t, const com32sys_t *, com32sys_t *);
- void *cs_bounce;
- uint32_t cs_bounce_size;
- void __cdecl(*cs_farcall)(uint32_t, const com32sys_t *, com32sys_t *);
- int __cdecl(*cs_cfarcall)(uint32_t, const void *, uint32_t);
- uint32_t cs_memsize;
- const char *cs_name;
- const struct com32_pmapi *cs_pm;
-} __com32;
-
-The intcall helper function can be used to issue BIOS or Syslinux API
-calls, and takes the interrupt number as first argument. The second
-argument is a pointer to the input register definition, an instance of
-the following structure (available in <com32.h>):
-
-typedef union {
- uint32_t l;
- uint16_t w[2];
- uint8_t b[4];
-} reg32_t;
-
-typedef struct {
- uint16_t gs; /* Offset 0 */
- uint16_t fs; /* Offset 2 */
- uint16_t es; /* Offset 4 */
- uint16_t ds; /* Offset 6 */
-
- reg32_t edi; /* Offset 8 */
- reg32_t esi; /* Offset 12 */
- reg32_t ebp; /* Offset 16 */
- reg32_t _unused_esp; /* Offset 20 */
- reg32_t ebx; /* Offset 24 */
- reg32_t edx; /* Offset 28 */
- reg32_t ecx; /* Offset 32 */
- reg32_t eax; /* Offset 36 */
-
- reg32_t eflags; /* Offset 40 */
-} com32sys_t;
-
-The third argument is a pointer to the output register definition, an
-instance of the same structure. The third argument can also be zero
-(NULL).
-
-Since BIOS or Syslinux API calls can generally only manipulate data
-below address 0x100000, a "bounce buffer" in low memory, at least 64K
-in size, is available, to copy data in and out.
-
-The farcall helper function behaves similarly, but takes as its first
-argument the CS:IP (in the form (CS << 16) + IP) of procedure to be
-invoked via a FAR CALL.
-
-The cfarcall helper function takes (CS << 16)+IP, a pointer to a stack
-frame, a size of that stack frame, and returns the return value of EAX
-(which may need to be appropriate truncated by the user.)
-
-Starting in version 4.00, some of these API calls are available as
-protected-mode function calls, using the regparm(3) calling convention
-(the first three argumetns in EAX, EDX, ECX; the rest on the stack.)
-Those functions are defined in struct com32_pmapi, defined in
-<syslinux/pmapi.h>.
-
-
- ++++ SYSLINUX API CALLS +++
-
-Syslinux provides the following API calls. Syslinux 1.xx only
-supported INT 20h - terminate program. [] indicates the first version
-of Syslinux which supported this feature (correctly.)
-
-NOTE: Most of the API functionality is still experimental. Expect to
-find bugs.
-
-
- ++++ DOS-COMPATIBLE API CALLS ++++
-
-INT 20h [1.48] Terminate program
-INT 21h AH=00h [2.00] Terminate program
-INT 21h AH=4Ch [2.00] Terminate program
-
- All of these terminate the program.
-
-
-INT 21h AH=01h [2.01] Get Key with Echo
-
- Reads a key from the console input, with echo to the console
- output. The read character is returned in AL. Extended
- characters received from the keyboard are returned as NUL (00h)
- + the extended character code.
-
-
-INT 21h AH=02h [2.01] Write Character
-
- Writes a character in DL to the console (video and serial)
- output.
-
-
-INT 21h AH=04h [2.01] Write Character to Serial Port
-
- Writes a character in DL to the serial console output
- (if enabled.) If no serial port is configured, this routine
- does nothing.
-
-
-INT 21h AH=08h [2.09] Get Key without Echo
-
- Reads a key fron the console input, without echoing it to the
- console output. The read character is returned in AL.
-
-
-INT 21h AH=09h [2.01] Write DOS String to Console
-
- Writes a DOS $-terminated string in DS:DX to the console.
-
-
-INT 21h AH=0Bh [2.00] Check Keyboard
-
- Returns AL=FFh if there is a keystroke waiting (which can then
- be read with INT 21h, AH=01h or AH=08h), otherwise AL=00h.
-
-
-INT 21h AH=30h [2.00] Check DOS Version
-
- This function returns AX=BX=CX=DX=0, corresponding to a
- hypothetical "DOS 0.0", but the high parts of EAX-EBX-ECX-EDX
- spell "SYSLINUX":
-
- EAX=59530000h EBX=4C530000h ECX=4E490000h EDX=58550000h
-
- This function can thus be used to distinguish running on
- Syslinux from running on DOS.
-
-
- ++++ SYSLINUX-SPECIFIC API CALLS ++++
-
-Syslinux-specific API calls are executed using INT 22h, with a
-function number in AX. INT 22h is used by DOS for internal purposes;
-do not execute INT 22h under DOS.
-
-DOS-compatible function INT 21h, AH=30h can be used to detect if the
-Syslinux API calls are available.
-
-Any register not specifically listed as modified is preserved;
-however, future versions of Syslinux may add additional output
-registers to existing calls.
-
-All calls return CF=0 on success, CF=1 on failure. The noted outputs
-apply if CF=0 only unless otherwise noted. All calls clobber the
-arithmetric flags (CF, PF, AF, ZF, SF and OF) but leave all other
-flags unchanged unless otherwise noted.
-
-
-AX=0001h [2.00] Get Version
-
- Input: AX 0001h
- Output: AX number of INT 22h API functions available
- CH Syslinux major version number
- CL Syslinux minor version number
- DL Syslinux derivative ID (e.g. 32h = PXELINUX)
- ES:SI Syslinux version string
- ES:DI Syslinux copyright string
-
- This API call returns the Syslinux version and API
- information.
-
- Note: before version 3.86, the version string had a leading CR LF
- and the copyright string had a leading space. The strings might
- still contain trailing CR and/or LF.
-
-
-AX=0002h [2.01] Write String
-
- Input: AX 0002h
- ES:BX null-terminated string
- Output: None
-
- Writes a null-terminated string on the console.
-
-
-AX=0003h [2.01] Run command
-
- Input: AX 0003h
- ES:BX null-terminated command string
- Output: Does not return
-
- This API call terminates the program and executes the command
- string as if the user had entered it at the Syslinux command
- line. This API call does not return.
-
-
-AX=0004h [2.01] Run default command
-
- Input: AX 0004h
- Output: Does not return
-
- This API call terminates the program and executes the default
- command string as if the user had pressed Enter alone on the
- Syslinux command line. This API call does not return.
-
-
-AX=0005h [2.00] Force text mode
-
- Input: AX 0005h
- Output: None
-
- If the screen was in graphics mode (due to displaying a splash
- screen using the <Ctrl-X> command in a message file, or
- similar), return to text mode.
-
-
-AX=0006h [2.08] Open file
-
- Input: AX 0006h
- ES:SI null-terminated filename
- Output: SI file handle
- EAX length of file in bytes, or -1
- CX file block size
-
- Open a file for reading. The exact syntax of the filenames
- allowed depends on the particular Syslinux derivative.
-
- The Syslinux file system is block-oriented. The size of a
- block will always be a power of two and no greater than 16K.
-
- Note: Syslinux considers a zero-length file to be nonexistent.
-
- In 3.70 or later, EAX can contain -1 indicating that the file
- length is unknown.
-
- 32-BIT VERSION:
-
- int cs_pm->open_file(const char *filename, struct com32_filedata *data)
-
- filename - null-terminated filename
- data - pointer to a file data buffer
-
- Returns the file handle, or -1 on failure.
- The file data buffer contains block size and file size.
-
-
-AX=0007h [2.08] Read file
-
- Input: AX 0007h
- SI file handle
- ES:BX buffer
- CX number of blocks to read
- Output: SI file handle, or 0 if EOF was reached
- ECX number of bytes read [3.70]
-
- Read blocks from a file. Note that the file handle that is
- returned in SI may not be the same value that was passed in.
-
- If end of file was reached (SI=0), the file was automatically
- closed.
-
- In 3.70 or later, ECX returns the number of bytes read. This
- will always be a multiple of the block size unless EOF is
- reached.
-
- The address of the buffer (ES:BX) should be at least 512-byte
- aligned. Syslinux guarantees at least this alignment for the
- COMBOOT load segment or the COM32 bounce buffer.
-
- Keep in mind that a "file" may be a TFTP connection, and that
- leaving a file open for an extended period of time may result
- in a timeout.
-
- WARNING: Calling this function with an invalid file handle
- will probably crash the system.
-
- 32-BIT VERSION:
-
- size_t cs_pm->read_file(uint16_t *handle, void *buf, size_t blocks)
-
- handle - file handle (input and output, set to zero on end of file)
- buf - buffer to write to
- blocks - number of blocks to read
-
- Returns number of bytes read, or 0 on failure.
-
-
-AX=0008h [2.08] Close file
-
- Input: AX 0008h
- SI file handle
- Output: None
-
- Close a file before reaching the end of file.
-
- WARNING: Calling this function with an invalid file handle
- will probably crash the system.
-
- 32-BIT VERSION:
-
- void cs_pm->close_file(uint16_t handle)
-
- handle - file handle to close
-
-
-AX=0009h [2.00] Call PXE Stack [PXELINUX ONLY]
-
- Input: AX 0009h
- BX PXE function number
- ES:DI PXE parameter structure buffer
- Output: AX PXE return status code
-
- Invoke an arbitrary PXE stack function. On SYSLINUX/ISOLINUX,
- this function returns with an error (CF=1) and no action is
- taken. On PXELINUX, this function always returns with CF=0
- indicating that the PXE stack was successfully invoked; check
- the status code in AX and in the first word of the data buffer
- to determine if the PXE call succeeded or not.
-
- The PXE stack will have the UDP stack OPEN; if you change that
- you cannot call any of the file-related API functions, and
- must restore UDP OPEN before returning to PXELINUX.
-
- PXELINUX reserves UDP port numbers from 49152 to 65535 for its
- own use; port numbers below that range is available.
-
-
-AX=000Ah [2.00] Get Derivative-Specific Information
-
- [SYSLINUX, EXTLINUX]
- Input: AX 000Ah
- CL 9 (to get a valid return in CL for all versions)
- Output: AL 31h (SYSLINUX), 34h (EXTLINUX)
- DL drive number
- CL sector size as a power of 2 (9 = 512 bytes) [3.35]
- CH mode [3.73]
- 1 = CBIOS mode
- 2 = EBIOS mode
- ES:BX pointer to partition table entry (if DL >= 80h)
- FS:SI pointer to initial ES:DI value [3.53]
- GS:DI pointer to partition offset (QWORD) [4.00]
-
- Note: This function was broken in EXTLINUX 3.00-3.02.
-
- On boot, ES:DI is supposed to point to the BIOS $PnP
- structure, although in practice most operating systems
- will search for it in memory. However, preserving
- this while chainloading is probably a good idea.
-
- Note that FS:SI is a pointer to a memory location
- containing the original ES:DI value, not the value
- itself.
-
-
- [PXELINUX]
- Input: AX 000Ah
- Output: AL 32h (PXELINUX)
- DX PXE API version detected (DH=major, DL=minor)
- ECX Local IP number (network byte order) [3.85]
- ES:BX pointer to PXENV+ or !PXE structure
- FS:SI pointer to original stack with invocation record
- GS:DI pointer to network information [4.00]
-
- Note: DX notes the API version detected by PXELINUX,
- which may be more conservative than the actual version
- available. For exact information examine the API
- version entry in the PXENV+ structure, or the API
- version entries in the ROMID structures pointed from
- the !PXE structure.
-
- PXELINUX will use, and provide, the !PXE structure
- over the PXENV+ structure. Examine the structure
- signature to determine which particular structure was
- provided.
-
- The FS:SI pointer points to the top of the original stack
- provided by the PXE stack, with the following values
- pushed at the time PXELINUX is started:
-
- [fs:si+0] GS <- top of stack
- [fs:si+2] FS
- [fs:si+4] ES
- [fs:si+6] DS
- [fs:si+8] EDI
- [fs:si+12] ESI
- [fs:si+16] EBP
- [fs:si+20] -
- [fs:si+24] EBX
- [fs:si+28] EDX
- [fs:si+32] ECX
- [fs:si+36] EAX
- [fs:si+40] EFLAGS
- [fs:si+44] PXE return IP <- t.o.s. when PXELINUX invoked
- [fs:si+46] PXE return CS
-
- GS:DI points to a structure of the following form:
-
- [gs:di+0] 4 - IPv4
- [gs:di+4] My IP
- [gs:di+8] Boot server IP
- [gs:di+12] Gateway IP
- [gs:di+16] Netmask
-
- [ISOLINUX]
- Input: AX 000Ah
- Output: AL 33h (ISOLINUX)
- DL drive number
- CL 11 (sector size as a power of 2) [3.35]
- CH mode [3.73]
- 0 = El Torito
- 1 = Hybrid (hard disk), CBIOS mode
- 2 = Hybrid (hard disk), EBIOS mode
- ES:BX pointer to El Torito spec packet
- FS:SI pointer to initial ES:DI value [3.53]
- GS:DI pointer to partition offset (QWORD) [4.00]
-
- Note: Some very broken El Torito implementations do
- not provide the spec packet information. If so, ES:BX
- may point to all zeroes or to garbage. Call INT 13h,
- AX=4B01h to obtain the spec packet directly from the
- BIOS if necessary.
-
-
-AX=000Bh [2.00] Get Serial Console Configuration
-
- Input: AX 000Bh
- Output: DX serial port I/O base (e.g. 3F8h = COM1...)
- CX baud rate divisor (1 = 115200 bps, 2 = 57600 bps...)
- BX flow control configuration bits (see syslinux.txt)
- -> bit 15 is set if the video console is disabled
-
- If no serial port is configured, DX will be set to 0 and the
- other registers are undefined.
-
-
-AX=000Ch [2.00] Perform final cleanup
- Input: AX 000Ch
- DX derivative-specific flags (0000h = clean up all)
- Output: None
-
- This routine performs any "final cleanup" the boot loader
- would normally perform before loading a kernel, such as
- unloading the PXE stack in the case of PXELINUX. AFTER
- INVOKING THIS CALL, NO OTHER API CALLS MAY BE INVOKED, NOR MAY
- THE PROGRAM TERMINATE AND RETURN TO THE BOOT LOADER. This
- call basically tells the boot loader "get out of the way, I'll
- handle it from here."
-
- For COM32 images, the boot loader will continue to provide
- interrupt and BIOS call thunking services as long its memory
- areas (0x0800-0xffff, 0x100000-0x100fff) are not overwritten.
- MAKE SURE TO DISABLE INTERRUPTS, AND INSTALL NEW GDT AND IDTS
- BEFORE OVERWRITING THESE MEMORY AREAS.
-
- The permissible values for DX is an OR of these values:
-
- SYSLINUX: 0000h Normal cleanup
-
- PXELINUX: 0000h Normal cleanup
- 0003h Keep UNDI and PXE stacks loaded
-
- ISOLINUX: 0000h Normal cleanup
-
- EXTLINUX: 0000h Normal cleanup
-
- All other values are undefined, and may have different
- meanings in future versions of Syslinux.
-
-
-AX=000Dh [2.08] Obsoleted in 3.80
-
-
-AX=000Eh [2.11] Get configuration file name
- Input: AX 0000Eh
- Output: ES:BX null-terminated file name string
-
- Returns the name of the configuration file. Note that it is
- possible that the configuration file doesn't actually exist.
-
-
-AX=000Fh [3.00] Get IPAPPEND strings [PXELINUX]
- Input: AX 000Fh
- Output: CX number of strings (currently 2)
- ES:BX pointer to an array of NEAR pointers in
- the same segment, one for each of the above
- strings
-
- Returns the same strings that the "ipappend" option would have
- added to the command line, one for each bit of the "ipappend"
- flag value, so entry 0 is the "ip=" string and entry 1 is the
- "BOOTIF=" string.
-
-
-AX=0010h [3.00] Resolve hostname [PXELINUX]
- Input: AX 0010h
- ES:BX pointer to null-terminated hostname
- Output: EAX IP address of hostname (zero if not found)
-
- Queries the DNS server(s) for a specific hostname. If the
- hostname does not contain a dot (.), the local domain name
- is automatically appended.
-
- This function only return CF=1 if the function is not
- supported. If the function is supported, but the hostname did
- not resolve, it returns with CF=0, EAX=0.
-
- The IP address is returned in network byte order, i.e. if the
- IP address is 1.2.3.4, EAX will contain 0x04030201. Note that
- all uses of IP addresses in PXE are also in network byte order.
-
-
-AX=0011h [3.05] Obsoleted in 3.80
-
-
-AX=0012h [3.50] Obsoleted in 3.80
-
-
-AX=0013h [3.08] Idle loop call
- Input: AX 0013h
- Output: None
-
- Call this routine while sitting in an idle loop. It performs
- any periodic activities required by the filesystem code. At
- the moment, this is a no-op on all derivatives except
- PXELINUX, where it executes PXE calls to answer ARP queries.
-
- Starting with version 3.10, this API call harmlessly returns
- failure (CF=1) if invoked on a platform which does not need
- idle calls. Additionally, it's safe to call this API call on
- previous Syslinux versions (2.00 or later); it will just
- harmlessly fail. Thus, if this call returns failure (CF=1),
- it means that there is no technical reason to call this
- function again, although doing so is of course safe.
-
-
-AX=0014h [3.10] Local boot [PXELINUX, ISOLINUX]
- Input: AX 0014h
- DX Local boot parameter
- Output: Does not return
-
- This function invokes the equivalent of the "localboot"
- configuration file option. The parameter in DX is the same
- parameter as would be entered after "localboot" in the
- configuration file; this parameter is derivative-specific --
- see syslinux.txt for the definition.
-
-
-AX=0015h [3.10] Get feature flags
- Input: AX 0015h
- Output: ES:BX pointer to flags in memory
- CX number of flag bytes
-
- This function reports whether or not this Syslinux version and
- derivative supports specific features. Keep in mind that
- future versions might have more bits; remember to treat any
- bits beyond the end of the array (as defined by the value in
- CX) as zero.
-
- Currently the following feature flag is defined:
-
- Byte Bit Definition
- ----------------------------------------------------
- 0 0 Local boot (AX=0014h) supported
- 1 Idle loop call (AX=0013h) is a no-op
-
- All other flags are reserved.
-
-
-AX=0016h [3.10] Run kernel image
- Input: AX 0016h
- DS:SI Filename of kernel image (zero-terminated string)
- ES:BX Command line (zero-terminated string)
- ECX IPAPPEND flags [PXELINUX]
- EDX Type of file (since 3.50)
- Output: Does not return if successful; returns with CF=1 if
- the kernel image is not found.
-
- This function is similiar to AX=0003h Run command, except that
- the filename and command line are treated as if specified in a
- KERNEL and APPEND statement of a LABEL statement, which means:
-
- - The filename has to be exact; no variants are tried;
- - No global APPEND statement is applied;
- - ALLOWOPTIONS and IMPLICIT statements in the configuration
- file do not apply. It is therefore important that the
- COMBOOT module doesn't allow the end user to violate the
- intent of the administrator.
-
- Additionally, this function returns with a failure if the file
- doesn't exist, instead of returning to the command line. (It
- may still return to the command line if the image is somehow
- corrupt, however.)
-
- The file types are defined as follows:
-
- Equivalent
- EDX Config Extensions Type of file
- 0 KERNEL Determined by filename extension
- 1 LINUX none Linux kernel image
- 2 BOOT .bs .bin Bootstrap program
- 3 BSS .bss Boot sector with patch [SYSLINUX]
- 4 PXE .0 PXE Network Bootstrap Prog [PXELINUX]
- 5 FDIMAGE .img Floppy disk image [ISOLINUX]
- 6 COMBOOT .com .cbt 16-bit COMBOOT program
- 7 COM32 .c32 COM32 program
- 8 CONFIG Configuration file
-
-
-AX=0017h [3.30] Report video mode change
- Input: AX 0017h
- BX Video mode flags
- Bit 0: graphics mode
- Bit 1: non-default mode
- Bit 2: VESA mode
- Bit 3: text functions not supported
- CX For graphics modes, pixel columns
- DX For graphics modes, pixel rows
- Output: None
-
- This function is used to report video mode changes to
- Syslinux. It does NOT actually change the video mode, but
- rather, allows Syslinux to take appropriate action in response
- to a video mode change. Modes that cannot be exited either
- with the conventional BIOS mode set command (INT 10h, AH=00h)
- or the VESA VBE mode set command (INT 10h, AX=4F02h) should
- not be used.
-
- This function returns with a failure if BX contains any bits
- which are undefined in the current version of Syslinux.
-
- The following bits in BX are currently defined:
-
- Bit 0: graphics mode
-
- Indicates that the mode is a graphics mode, as opposed
- to a text mode.
-
- Bit 1: non-standard mode
-
- A non-standard mode is any mode except text mode and
- graphics mode 0012h (VGA 640x480, 16 color.)
-
- Bit 2: VESA mode
-
- This mode is a VESA mode, and has to be exited with
- the VESA VBE API (INT 10h, AX=4F02h) as opposed to the
- conventional BIOS API (INT 10h, AH=00h).
-
- Bit 3: Text functions not supported
-
- This indicates that the BIOS text output functions
- (INT 10h, AH=02h, 03h, 06h, 09h, 0Eh, 11h) don't work.
- If this bit is set, Syslinux will reset the mode
- before printing any characters on the screen.
-
- This is common for VESA modes.
-
-
-AX=0018h [3.30] Query custom font
- Input: AX 0018h
- Output: AL Height of custom font in scan lines, or zero
- ES:BX Pointer to custom font in memory
-
- This call queries if a custom display font has been loaded via
- the "font" configuration file command. If no custom font has
- been loaded, AL contains zero.
-
-
-AX=0019h [3.50] Read disk [SYSLINUX, ISOLINUX, EXTLINUX]
- Input: AX 0019h
- EDX Sector number (LSW)
- ESI Sector number (MSW) [4.00]
- EDI Reserved - MUST BE ZERO
- CX Sector count
- ES:BX Buffer address
- Output: None
-
- Read disk blocks from the active filesystem (partition); for
- disks, sector number zero is the boot sector. For ISOLINUX,
- this call reads the CD-ROM.
-
- For compatiblity with all systems, the buffer should
- *neither* cross 64K boundaries, *nor* wrap around the segment.
-
- This routine reports "boot failed" (and does not return) on
- disk error.
-
- Note: for ISOLINUX in hybrid mode, this call uses simulated
- 2048-byte CD-ROM sector numbers.
-
-
-AX=001Ah [3.50] Obsoleted in 3.80
-
-
-AX=001Bh [3.50] Obsoleted in 3.80
-
-
-AX=001Ch [3.60] Get pointer to auxilliary data vector
- Input: AX 001Ch
- Output: ES:BX Auxilliary data vector
- CX Size of the ADV (currently 500 bytes)
-
- The auxillary data vector is a tagged data structure used
- to carry a small amount of information (up to 500 bytes) from
- one boot to another.
-
-
-AX=001Dh [3.60] Write auxilliary data vector
- Input: AX 001Dh
- Output: None
-
- Write the auxilliary data vector back to disk. Returns
- failure for non-disk-based derivatives unless the "auxdata"
- configuration command is used to specify a disk location
- (not yet implemented.)
-
- In a future version, PXELINUX may end up attempting to save
- the ADV on the server via TFTP write.
-
-
-AX=001Eh [3.74] Keyboard remapping table
- Input: AX 001Eh
- DX 0000h - all other values reserved
- Output: AX format version (1)
- CX length in bytes (256)
- ES:BX pointer to keyboard table
-
- This call queries the keyboard remapping table. For the current
- version, the format code is always 1 and the length is always
- 256. This version can be updated simply by overwriting the version
- in memory; this may not be true in the future.
-
-
-AX=001Fh [3.74] Get current working directory
- Input: AX 0001Fh
- Output: ES:BX null-terminated directory name string
-
- Returns the current working directory.
-
-
-AX=0020h [3.74] Obsoleted in 4.00
-AX=0021h [3.74] Obsoleted in 4.00
-AX=0022h [3.74] Obsoleted in 4.00
-
- These three functions provided opendir/readdir/closedir
- functionality in the late 3.xx series. They have been
- replaced by the protected-mode interface.
-
-
-AX=0023h [3.80] Get shuffler parameters
- Input: AX 0023h
- Output: CX size of shuffler "safe area" in bytes
- Other registers reserved for future use
-
- This call gives the size of the required shuffler "safe area",
- in bytes; for call 0024h. In the future, it may provide
- additional parameters.
-
-
-AX=0024h [3.80] Cleanup, shuffle and boot, raw version
- Input: AX 0024h
- DX derivative-specific flags (see function 000Ch)
- EDI shuffle descriptor list safe area
- ESI shuffle descriptor list source
- ECX byte count of shuffle descriptor list
- Output: Does not return
-
- This routine performs final cleanup, then performs a sequence
- of copies, and jumps to a specified real mode entry point.
- This is a more general version of function 000Dh, which can
- also be used to load other types of programs.
-
- Unlike previous obsolete versions of this function, there are
- no restrictions that copies must not touch memory below
- address 7C00h. Either the shuffle descriptor list or the safe
- area (or both) may be located in high memory.
-
- ESI points to a list of descriptors each of the form:
-
- Offset Size Meaning
- 0 dword destination address
- 4 dword source address (-1 = zero)
- 8 dword length in bytes (0 = end of list)
-
- The copies are overlap-safe, like memmove().
-
- Before actually executing the move list, the list is moved to
- the address specified in EDI. The caller is responsibe to
- ensure that the moved descriptor list plus a "safe area"
- immediately afterwards (the size of which is specified by
- function 0023h) is not disturbed by the copy sequence. It is,
- however, safe to overwrite descriptors already consumed.
-
- If the source address is -1 (FFFFFFFFh) then the block
- specified by the destination address and the length is set to
- all zero.
-
- The list is terminated by an entry with length 0. For that
- entry, the destination is used as an entry point, and the
- source represents the type of entry point:
-
- 0 16-bit protected mode (dst is CS.base)
- 1 Flat 32-bit protected mode (dst is EIP)
-
- This routine does not set up any GPR register state
- whatsoever, including stack. It is the responsibility of the
- caller to make sure the entry point provided sets up any
- registers needed.
-
- For mode 0 (16-bit real mode), EAX will contain CR0 with bit 0
- masked out, suitable for loading into CR0 to immediately enter
- real mode. Note: if real-mode entry is planned,
- (CS.base & 0xfff0000f) should == 0 for compatibility with KVM,
- and possibly other virtualization solutions.
-
- In both mode 0 and mode 1, the data segments will be loaded
- with read/write data segments, matching the respective code
- segment. For mode 0, B=0 and the limits will be 64K, for mode
- 1, B=1 and the limits will be 4 GB.
-
-
- ++++ 32-BIT ONLY API CALLS ++++
-
-void *cs_pm->lmalloc(size_t bytes)
-
- Allocate a buffer in low memory (below 1 MB).
-
-
-void cs_pm->lfree(void *ptr)
-
- Free a buffer allocated with cs_pm->lmalloc().
-
-
-DIR *cs_pm->opendir(const char *pathname)
-
- Open a directory.
-
-
-struct dirent *cs_pm->readdir(DIR *dir)
-
- Read an entry from a directory. The entry is returned in a
- static buffer.
-
-
-int cs_pm->closedir(DIR *dir)
-
- Close a directory.
diff --git a/doc/extlinux.txt b/doc/extlinux.txt
index 9b267018..d8cbb5df 100644
--- a/doc/extlinux.txt
+++ b/doc/extlinux.txt
@@ -49,8 +49,8 @@ slight modifications.
5. EXTLINUX now has "boot-once" support. The boot-once information is
stored in an on-disk datastructure, part of extlinux.sys, called
the "Auxillary Data Vector". The Auxilliary Data Vector is also
- available to COMBOOT/COM32 modules that want to store small amounts
- of information.
+ available to COM32 modules that want to store small amounts of
+ information.
To set the boot-once information, do:
diff --git a/doc/mboot.txt b/doc/mboot.txt
index ef00ca5c..4f8c7b10 100644
--- a/doc/mboot.txt
+++ b/doc/mboot.txt
@@ -2,7 +2,7 @@
mboot.c32
---------
-mboot.c32 is a 32-bit comboot module that allows Syslinux and its
+mboot.c32 is a 32-bit ELF module that allows Syslinux and its
variants to load and boot kernels that use the Multiboot standard
(e.g. the Xen virtual machine monitor, and the Fiasco and GNU Mach
microkernels).
diff --git a/doc/syslinux.txt b/doc/syslinux.txt
index 34dcb97a..caf3a06c 100644
--- a/doc/syslinux.txt
+++ b/doc/syslinux.txt
@@ -214,7 +214,7 @@ LABEL label
append myoptions
Note: The "kernel" doesn't have to be a Linux kernel; it can
- be a boot sector or a COMBOOT file (see below.)
+ be a boot sector (see below.)
Since version 3.32 label names are no longer mangled into DOS
format (for SYSLINUX.)
@@ -226,7 +226,6 @@ LABEL label
BSS image - BSS image (.bss)
PXE image - PXE Network Bootstrap Program (.0)
FDIMAGE image - Floppy disk image (.img)
- COMBOOT image - COMBOOT program (.com, .cbt)
COM32 image - COM32 program (.c32)
CONFIG image - New configuration file
Using one of these keywords instead of KERNEL forces the
@@ -566,17 +565,15 @@ The command line prompt supports the following keystrokes:
<Ctrl-N> display network information (PXELINUX only)
- ++++ COMBOOT IMAGES AND OTHER OPERATING SYSTEMS ++++
+ ++++ OTHER OPERATING SYSTEMS ++++
This version of Syslinux supports chain loading of other operating
-systems (such as MS-DOS and its derivatives, including Windows 95/98),
-as well as COMBOOT-style standalone executables (a subset of DOS .COM
-files; see separate section below.)
+systems (such as MS-DOS and its derivatives, including Windows 95/98).
Chain loading requires the boot sector of the foreign operating system
to be stored in a file in the root directory of the filesystem.
-Because neither Linux kernels, boot sector images, nor COMBOOT files
-have reliable magic numbers, Syslinux will look at the file extension.
+Because neither Linux kernels, nor boot sector images have reliable
+magic numbers, Syslinux will look at the file extension.
The following extensions are recognized (case insensitive):
none or other Linux kernel image
@@ -584,9 +581,7 @@ The following extensions are recognized (case insensitive):
.bin "CD boot sector" [ISOLINUX only]
.bs Boot sector [SYSLINUX only]
.bss Boot sector, DOS superblock will be patched in [SYSLINUX only]
- .c32 COM32 image (32-bit COMBOOT)
- .cbt COMBOOT image (not runnable from DOS)
- .com COMBOOT image (runnable from DOS)
+ .c32 COM32 image (32-bit ELF)
.img Disk image [ISOLINUX only]
For filenames given on the command line, Syslinux will search for the
@@ -595,7 +590,7 @@ filename is not found. Filenames in KERNEL statements must be fully
qualified.
If this is specified with one of the keywords LINUX, BOOT, BSS,
-FDIMAGE, COMBOOT, COM32, or CONFIG instead of KERNEL, the filetype is
+FDIMAGE, COM32, or CONFIG instead of KERNEL, the filetype is
considered to be the one specified regardless of the filename.
@@ -675,17 +670,6 @@ syslinux.exe instead.
copy initrd.gz a:
- ++++ COMBOOT EXECUTABLES ++++
-
-Syslinux supports simple standalone programs, using a file format
-similar to DOS ".com" files. A 32-bit version, called COM32, is also
-provided. A simple API provides access to a limited set of filesystem
-and console functions.
-
-See the file comboot.txt for more information on COMBOOT and COM32
-programs.
-
-
++++ NOVICE PROTECTION ++++
Syslinux will attempt to detect booting on a machine with too little
diff --git a/man/syslinux.1 b/man/syslinux.1
index af44979b..adcaf94d 100644
--- a/man/syslinux.1
+++ b/man/syslinux.1
@@ -141,8 +141,7 @@ and if no "append" is given the default is to use the global entry (if any).
Use "append -" to use no options at all. Up to 128 "label" entries are
permitted.
.IP
-The "image" doesn't have to be a Linux kernel; it can be a boot sector or a
-COMBOOT file (see below.)
+The "image" doesn't have to be a Linux kernel; it can be a boot sector (see below.)
.RE
.TP
.BI implicit\ flag_val
@@ -297,25 +296,21 @@ For example:
.TP
\fI<SUB>\fP = \fI<Ctrl-Z>\fP = ASCII 26
End of file (DOS convention).
-.SS Comboot Images and other operating systems
+.SS Other operating systems
This version of \fBsyslinux\fP supports chain loading of other operating
-systems (such as MS-DOS and its derivatives, including Windows 95/98),
-as well as COMBOOT-style standalone executables (a subset of DOS .COM
-files; see separate section below.)
+systems (such as MS-DOS and its derivatives, including Windows 95/98).
.PP
Chain loading requires the boot sector of the foreign operating system
to be stored in a file in the root directory of the filesystem.
-Because neither Linux kernels, boot sector images, nor COMBOOT files
-have reliable magic numbers, \fBsyslinux\fP will look at the file
+Because neither Linux kernels, nor boot sector images have reliable magic
+numbers, \fBsyslinux\fP will look at the file
extension. The following extensions are recognised:
.PP
.nf
.ta \w'none or other 'u
none or other Linux kernel image
-CBT COMBOOT image (not runnable from DOS)
BSS Boot sector (DOS superblock will be patched in)
BS Boot sector
-COM COMBOOT image (runnable from DOS)
.fi
.PP
For filenames given on the command line, \fBsyslinux\fP will search for the
@@ -323,29 +318,6 @@ file by adding extensions in the order listed above if the plain
filename is not found. Filenames in KERNEL statements must be fully
qualified.
.PP
-A COMBOOT file is a standalone executable in DOS .COM format. They
-can, among other things, be produced by the Etherboot package by
-Markus Gutschke and Ken Yap. The following requirements apply for
-these files to be sufficiently "standalone" for \fBsyslinux\fP to be able to
-load and run them:
-.IP \(bu
-The program must not execute any DOS calls (since there is no
-DOS), although it may call the BIOS. The only exception is that
-the program may execute INT 20h (Terminate Program) to return to
-the \fBsyslinux\fP prompt. Note especially that INT 21h AH=4Ch, INT 21h
-AH=31h or INT 27h are not supported.
-.IP \(bu
-Only the fields pspInt20 at offset 00h, pspNextParagraph at offset 02h and
-pspCommandTail at offset 80h (contains the arguments from the \fBsyslinux\fP command
-line) in the PSP are supported. All other fields will contain zero.
-.IP \(bu
-The program must not modify any main memory outside its 64K segment if it
-returns to \fBsyslinux\fP via INT 20h.
-.PP
-\fBSyslinux\fP currently doesn't provide any form of API for the use of
-COMBOOT files. If there is need, a future version may contain an INT
-interface to some \fBsyslinux\fP functions; please contact me if you have a
-need or ideas for such an API.
.SS Novice protection
\fBSyslinux\fP will attempt to detect if the user is trying to boot on a 286
or lower class machine, or a machine with less than 608K of low ("DOS")
diff --git a/modules/Makefile b/modules/Makefile
deleted file mode 100644
index f878c70d..00000000
--- a/modules/Makefile
+++ /dev/null
@@ -1,61 +0,0 @@
-## -----------------------------------------------------------------------
-##
-## Copyright 2001-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.
-##
-## -----------------------------------------------------------------------
-
-##
-## Non-COM32 simple Syslinux modules
-##
-
-topdir = ..
-MAKEDIR = $(topdir)/mk
-include $(MAKEDIR)/embedded.mk
-
-INCLUDES = -I$(com32)/include
-
-BINS = pxechain.com poweroff.com int18.com ver.com
-
-all: $(BINS)
-
-.PRECIOUS: %.o
-
-.PRECIOUS: %.elf
-%.elf: c32entry.o %.o $(LIB)
- $(LD) -Ttext 0x101000 -e _start -o $@ $^
-
-%.c32: %.elf
- $(OBJCOPY) -O binary $< $@
-
-%.com: %.asm
- ( $(NASM) -M -DDEPEND -o $@ $< ; echo '' ) > .$@.d ; true
- $(NASM) $(NASMOPT) -f bin -o $@ -l $*.lst $<
-
-$(LIB): $(LIBOBJS)
- rm -f $@
- $(AR) cq $@ $^
- $(RANLIB) $@
-
-%.lss: %.ppm.gz $(PPMTOLSS16)
- $(GZIPPROG) -cd $< | \
- $(PPMTOLSS16) \#000000=0 \#d0d0d0=7 \#f6f6f6=15 \
- > $@
-
-%.ppm.gz: %.png
- $(PNGTOPNM) $< | gzip -9 > $@
-
-tidy dist:
- rm -f *.o *.a *.lst *.elf *.map .*.d
-
-clean: tidy
-
-spotless: clean
- rm -f $(BINS)
-
--include .*.d
diff --git a/modules/int18.asm b/modules/int18.asm
deleted file mode 100644
index a13ada75..00000000
--- a/modules/int18.asm
+++ /dev/null
@@ -1,16 +0,0 @@
- bits 16
- org 100h
-_start:
- mov ax,5
- int 22h
- mov ah,09h
- mov dx,msg
- int 21h
- mov ax,000Ch
- xor dx,dx
- int 22h
- int 18h
- jmp 0F000h:0FFF0h ; INT 18h should not return...
-
- section .data
-msg: db 'Local boot via INT 18...', 13, 10, '$'
diff --git a/modules/poweroff.asm b/modules/poweroff.asm
deleted file mode 100644
index f4f19a2f..00000000
--- a/modules/poweroff.asm
+++ /dev/null
@@ -1,102 +0,0 @@
-; ****************************************************************************
-;
-; poweroff.asm
-;
-; Copyright 2009 Sebastian Herbszt
-;
-; APM poweroff module.
-;
-; 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.
-;
-; ****************************************************************************
-
- absolute 0
-pspInt20: resw 1
-pspNextP: resw 1
- resb 124
-pspCmdLen: resb 1
-pspCmdArg: resb 127
-
- section .text
- org 0x100
-
-_start:
- mov ax,5300h ; APM Installation Check (00h)
- xor bx,bx ; APM BIOS (0000h)
- int 15h
- jnc check_sig
-
- mov bx, msg_notpresent
- jmp error
-
-check_sig:
- cmp bx,504Dh ; signature 'PM'
- je check_ver
-
- mov bx, msg_notpresent
- jmp error
-
-check_ver:
- cmp ax,0101h ; Need version 1.1+
- jae check_state
-
- mov bx, msg_notsup
- jmp error
-
-check_state:
- test cx,8 ; bit 3 APM BIOS Power Management disabled
- jz connect
-
- mov bx, msg_pmdisabled
- jmp error
-
-connect:
- mov ax,5301h ; APM Real Mode Interface Connect (01h)
- xor bx,bx ; APM BIOS (0000h)
- int 15h
- jnc connect_ok
-
- mov bx, msg_connect
- jmp error
-
-connect_ok:
- mov ax,530Eh ; APM Driver Version (0Eh)
- xor bx,bx ; APM BIOS (0000h)
- mov cx,0101h ; APM Driver version 1.1
- int 15h
- jnc apm0101_check
-
- mov bx, msg_notsup
- jmp error
-
-apm0101_check:
- cmp cx,0101h ; APM Connection version
- jae apm0101_ok
-
- mov bx, msg_notsup
- jmp error
-
-apm0101_ok:
- mov ax,5307h ; Set Power State (07h)
- mov bx,0001h ; All devices power managed by the APM BIOS
- mov cx,0003h ; Power state off
- int 15h
- jnc off
-
- mov bx, msg_failed
-
-error:
- mov ax,2
- int 22h
-off:
- ret
-
-msg_notpresent: db 'APM not present.',0dh,0ah,0
-msg_notsup: db 'APM 1.1+ not supported.',0dh,0ah,0
-msg_pmdisabled: db 'Power management disabled.',0dh,0ah,0
-msg_connect: db 'APM RM interface connect failed.',0dh,0ah,0
-msg_failed: db 'Power off failed.',0dh,0ah,0
diff --git a/modules/pxechain.asm b/modules/pxechain.asm
deleted file mode 100644
index 35c19691..00000000
--- a/modules/pxechain.asm
+++ /dev/null
@@ -1,558 +0,0 @@
-; "$Id: pxechain.asm,v 1.2 2007/12/16 08:15:39 jhutz Exp $"
-; -*- fundamental -*- (asm-mode sucks) vim:noet:com=\:;
-; ****************************************************************************
-;
-; pxechain.asm
-;
-; A comboot program to chain from PXELINUX to another PXE network
-; bootstrap program (NBP). This improves on PXELINUX's built-in PXE
-; chaining support by arranging for the server address and boot filename
-; reported by the PXE stack to be those from which the new NBP was
-; loaded, allowing PXELINUX to be used to select from multiple NBP's,
-; such as gPXE, another PXELINUX(*), Windows RIS, and so on.
-;
-; (*) This seems unnecessary at first, but it is very helpful when
-; selecting from among self-contained network boot images.
-;
-; Copyright (c) 2007 Carnegie Mellon University
-; Copyright (C) 1994-2007 H. Peter Anvin
-;
-; 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.
-;
-; ****************************************************************************
-
-;%define DEBUG
-;%define NO_RUN
-
- absolute 0
-pspInt20: resw 1
-pspNextP: resw 1
- resb 124
-pspCmdLen: resb 1
-pspCmdArg: resb 127
-
- section .text
- org 0x100
-
-%ifdef DEBUG
-%macro MARK 1.nolist
- mov ah,0x02
- mov dl,%1&0xff
- int 0x21
-%if (%1 >> 8) & 0xff
- mov dl,(%1 >> 8) & 0xff
- int 0x21
-%if (%1 >> 16) & 0xff
- mov dl,(%1 >> 16) & 0xff
- int 0x21
-%if (%1 >> 24) & 0xff
- mov dl,(%1 >> 24) & 0xff
- int 0x21
-%endif
-%endif
-%endif
- mov dl,' '
- int 0x21
-%endmacro
-%macro SHOWD 1.nolist
- mov al,%1
- call print_dec
- mov ah,0x02
- mov dl,' '
- int 0x21
-%endmacro
-%macro SHOWX 1.nolist
- mov bx,%1
- call print_hex
- mov ah,0x02
- mov dl,' '
- int 0x21
-%endmacro
-%else
-%macro MARK 1.nolist
-%endmacro
-%macro SHOWD 1.nolist
-%endmacro
-%macro SHOWX 1.nolist
-%endmacro
-%endif
-
-_start:
- MARK 'INIT'
-
-; There should be exactly one command-line argument, which is of the form
-; [[ipaddress]::]tftp_filename, just like filenames given to PXELINUX.
-; Too few or too many arguments is an error.
-;
-; This code is based on mangle_name in pxelinux.asm
-parse_args:
- cld
- xor cx,cx
- mov cl,[pspCmdLen]
- dec cx
- mov si,pspCmdArg+1
- and cx,cx
- je near usage ; no args is bad
- add si,cx
- dec si
- std
-.chomp: lodsb
- cmp al,' '
- loopz .chomp
- inc cx
- cld
- mov [pspCmdLen],cl
- mov si,pspCmdArg+1
- cmp word [si],'::' ; Leading ::?
- je near gotprefix
- dec cx
- jz noip
- MARK 'SCAN'
-
-.more:
- inc si
- cmp byte [si],' '
- je near usage
- cmp word [si],'::'
- je near parse_ip
- loop .more
-
-noip:
- MARK 'NOIP'
- mov ax,0x0e ; get config file name
- int 0x22
- mov si,bx
-%ifdef DEBUG
- mov ah,0x02
- mov dl,'['
- int 0x21
- mov ax,0x02
- int 0x22
- mov ah,0x02
- mov dl,']'
- int 0x21
- mov dl,' '
- int 0x21
-%endif
- push ds
- push es
- pop ds
- pop es
- push es
-.find_prefix:
- lodsb
- and al,al
- jnz .find_prefix
- dec si
-
- mov cx,si
- sub cx,bx
- MARK 'LEN'
- SHOWD cl ; assume it's <256 for debugging
- dec si
- std
-.find_slash:
- lodsb
- cmp al,'/'
- je .slash
- loop .find_slash
-.slash:
- cmp cx,127
- cld
- jna .copy_prefix
- pop ds
- jmp too_long
-
-.copy_prefix:
- SHOWD cl
- MARK 'PFX'
- mov si,bx
- mov di,tftp_filename
- mov bx,128
- sub bx,cx
- rep movsb
- pop ds
-
- mov cl,[pspCmdLen]
- mov si,pspCmdArg+1
- jmp prefix_done
-
-usage:
- xor cx,cx
- mov si,msg_usage
- jmp fail
-
-too_long:
- xor cx,cx
- mov si,msg_too_long
- jmp fail
-
-parse_ip:
- MARK 'PIP'
- mov di,si
- mov si,pspCmdArg+1
- call parse_dotquad
- jc .notdq
- cmp si,di ; is it the same place?
- jne .notdq
- mov [tftp_siaddr],eax
- jmp gotprefix
-.notdq:
- MARK 'NDQ'
- mov si,di
- mov bx,pspCmdArg+1
- mov ax,0x0010 ; DNS resolve
- int 0x22
- and eax,eax
- jz noip
- mov [tftp_siaddr],eax
-gotprefix:
- MARK 'GOTP'
- dec cx ; skip the ::
- dec cx
- inc si
- inc si
- mov di,tftp_filename
- mov bx,128
-
-prefix_done:
- SHOWD bl
- MARK 'LEFT'
-
-; SI points at the filename, plus remaining arguments,
-; CX contains their combined length.
-; DI points to where the filename should be stored
-; BX says how much space is left for the filename and NUL
-
- and cx,cx
- jz usage ; no args is bad
-.copy_filename:
- lodsb
-%ifdef DEBUG
- mov dl,al
- mov ah,0x2
- int 0x21
-%endif
- cmp al,' '
- je usage
- dec bx
- jz too_long
- stosb
- loop .copy_filename
- xor eax,eax
- stosb
-
-; get PXE cached data
- MARK 'GCI'
- mov ax,0x0009 ; call PXE stack
- mov bx,0x0071 ; PXENV_GET_CACHED_INFO
- mov di,PXECacheParms
- int 0x22
- and eax,eax
- jz .fix_siaddr
- mov cx,[gci_status]
- mov si,msg_get_cache
- jmp fail
-
-.fix_siaddr:
- mov bx,[gci_bufferseg]
- mov es,bx
- mov bx,[gci_buffer]
- mov eax,[es:bx+12] ; save our address (ciaddr)
- mov [open_ciaddr],eax ; ... in case we have to do UDP open
- mov eax,[tftp_siaddr]
- and eax,eax
- jnz .replace_addr
- MARK 'ADDR'
- mov eax,[es:bx+20] ; siaddr
- mov [tftp_siaddr],eax
- jmp .addr_done
-.replace_addr:
- mov [es:bx+20],eax
-.addr_done:
- mov si,tftp_filename ; copy the new filename...
- lea di,[es:bx+108] ; to the "cached DHCP response"
- mov cx,128
- rep movsb
- mov bx,ds ; restore es before proceeding
- mov es,bx
-
-; print out what we are doing
-%ifdef DEBUG
- mov ah,0x02 ; write character
- mov dl,0x0d ; print a CRLF first
- int 0x21
- mov dl,0x0a
- int 0x21
-%endif
- mov ax,0x0002 ; write string
- mov bx,msg_booting
- int 0x22
- mov ebx,[tftp_siaddr]
- call print_dotquad
- mov ah,0x02 ; write character
- mov dl,' '
- int 0x21
- mov ax,0x0002 ; write string
- mov bx,tftp_filename
- int 0x22
- mov ah,0x02 ; write character
- mov dl,0x0d
- int 0x21
- mov dl,0x0a
- int 0x21
-
-%ifndef NO_RUN
- mov ax,0x0009 ; call PXE stack
- mov bx,0x0031 ; PXENV_UDP_CLOSE
- mov di,PXECloseParms
- int 0x22
- mov cx,[close_status]
- mov si,msg_udp_close
- and ax,ax
- jnz fail
-
- mov ax,0x0009 ; call PXE stack
- mov bx,0x0073 ; PXENV_RESTART_TFTP
- mov di,PXERestartTFTPParms
- int 0x22
- mov cx,[tftp_status]
- mov si,msg_rst_tftp
- call fail
-
- mov ax,0x0009 ; call PXE stack
- mov bx,0x0030 ; PXENV_UDP_OPEN
- mov di,PXEOpenParms
- int 0x22
- mov cx,[open_status]
- mov si,msg_udp_open
- and ax,ax
- jnz fail
- ret
-%endif
-
-fail:
- MARK 'FAIL'
- SHOWX cs
- SHOWX ds
- SHOWX es
- SHOWX si
-%ifdef DEBUG
- mov ah,0x02 ; write character
- mov dl,0x0d ; print a CRLF first
- int 0x21
- mov dl,0x0a
- int 0x21
-%endif
- mov ax,0x0002 ; write string
- mov bx,msg_progname ; print our name
- int 0x22
- mov bx,si ; ... the error message
- int 0x22
- mov ah,0x02 ; write character
- jcxz .done
- mov dl,' ' ; ... and the error code, in []
- int 0x21
- mov dl,'['
- int 0x21
- mov bx,cx
- call print_hex
- mov ah,0x02 ; write character
- mov dl,']'
- int 0x21
-.done:
- mov dl,0x0d ; and finally a CRLF
- int 0x21
- mov dl,0x0a
- int 0x21
- ret
-
-
-; print_hex
-;
-; Take a 16-bit integer in BX and print it as 2 hex digits.
-; Destroys AX and DL.
-;
-print_hex:
- mov al,bh
- aam 16
- cmp ah,10
- jb .lt_a000
- add ah,'A'-'0'-10
-.lt_a000: add ah,'0'
- mov dl,ah
- mov ah,0x02 ; write character
- int 0x21
-
- cmp al,10
- jb .lt_a00
- add al,'A'-'0'-10
-.lt_a00: add al,'0'
- mov dl,al
- mov ah,0x02 ; write character
- int 0x21
-
- mov al,bl
- aam 16
- cmp ah,10
- jb .lt_a0
- add ah,'A'-'0'-10
-.lt_a0: add ah,'0'
- mov dl,ah
- mov ah,0x02 ; write character
- int 0x21
-
- cmp al,10
- jb .lt_a
- add al,'A'-'0'-10
-.lt_a: add al,'0'
- mov dl,al
- mov ah,0x02 ; write character
- int 0x21
- ret
-
-
-; print_dec
-;
-; Take an 8-bit integer in AL and print it in decimal.
-; Destroys AX and DL.
-;
-print_dec:
- cmp al,10 ; < 10?
- jb .lt10 ; If so, skip first 2 digits
-
- cmp al,100 ; < 100
- jb .lt100 ; If so, skip first digit
-
- aam 100
- ; Now AH = 100-digit; AL = remainder
- add ah,'0'
- mov dl,ah
- mov ah,0x02
- int 0x21
-
-.lt100:
- aam 10
- ; Now AH = 10-digit; AL = remainder
- add ah,'0'
- mov dl,ah
- mov ah,0x02
- int 0x21
-
-.lt10:
- add al,'0'
- mov dl,al
- mov ah,0x02
- int 0x21
- ret
-
-
-; print_dotquad
-;
-; Take an IP address (in network byte order) in EBX and print it
-; as a dotted quad.
-; Destroys EAX, EBX, ECX, EDX
-;
-print_dotquad:
- mov cx,3
-.octet:
- mov al,bl
- call print_dec
- jcxz .done
- mov ah,0x02
- mov dl,'.'
- int 0x21
- ror ebx,8 ; Move next char into LSB
- dec cx
- jmp .octet
-.done:
- ret
-
-
-; parse_dotquad:
-; Read a dot-quad pathname in DS:SI and output an IP
-; address in EAX, with SI pointing to the first
-; nonmatching character.
-;
-; Return CF=1 on error.
-;
-; No segment assumptions permitted.
-;
-parse_dotquad:
- push cx
- mov cx,4
- xor eax,eax
-.parseloop:
- mov ch,ah
- mov ah,al
- lodsb
- sub al,'0'
- jb .notnumeric
- cmp al,9
- ja .notnumeric
- aad ; AL += 10 * AH; AH = 0;
- xchg ah,ch
- jmp .parseloop
-.notnumeric:
- cmp al,'.'-'0'
- pushf
- mov al,ah
- mov ah,ch
- xor ch,ch
- ror eax,8
- popf
- jne .error
- loop .parseloop
- jmp .done
-.error:
- loop .realerror ; If CX := 1 then we're done
- clc
- jmp .done
-.realerror:
- stc
-.done:
- dec si ; CF unchanged!
- pop cx
- ret
-
- section .data
-msg_booting: db 'TFTP boot: ',0
-msg_progname: db 'pxechain: ',0
-msg_usage: db 'usage: pxechain.cbt [[ipaddress]::]filename',0dh,0ah,0
-msg_too_long: db 'pxechain: filename is too long (max 127)',0dh,0ah,0
-msg_get_cache: db 'PXENV_GET_CACHED_INFO',0
-msg_rst_tftp: db 'PXENV_RESTART_TFTP',0
-msg_udp_close: db 'PXENV_UDP_CLOSE',0
-msg_udp_open: db 'PXENV_UDP_OPEN',0
-
-PXECacheParms:
-gci_status: dw 0
-gci_packettype: dw 3 ; PXENV_PACKET_TYPE_CACHED_REPLY
-gci_buffersize: dw 0
-gci_buffer: dw 0
-gci_bufferseg: dw 0
-gci_bufferlim: dw 0
-
-PXERestartTFTPParms:
-tftp_status: dw 0
-tftp_filename: times 128 db 0
-tftp_bufsize: dd 0x00090000 ; available memory for NBP
-tftp_bufaddr: dd 0x00007c00 ; PXE NBP load address
-tftp_siaddr: dd 0
-tftp_giaddr: dd 0
-tftp_mcaddr: dd 0
-tftp_mcport: dw 0
-tftp_msport: dw 0
-tftp_timeout: dw 0
-tftp_reopendly: dw 0
-
-PXECloseParms:
-close_status: dw 0
-
-PXEOpenParms:
-open_status: dw 0
-open_ciaddr: dd 0
diff --git a/modules/ver.asm b/modules/ver.asm
deleted file mode 100644
index 600def02..00000000
--- a/modules/ver.asm
+++ /dev/null
@@ -1,606 +0,0 @@
-; ****************************************************************************
-;
-; ver.asm
-;
-; A COMBOOT/DOS COM program to display the version of the system
-; (Syslinux, DOS, or DRMK)
-;
-; Copyright (C) 2009-2010 Gene Cumm
-;
-; 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.
-;
-; ****************************************************************************
-
-; %define DEBUG
-
- section .text
- org 0x100
-
-_start:
- call crlf
- mov si,info_str
- call writestr
- call getdosver
- call chkprn_dosver
- jnz .end
- call chkprn_syslinux
- call crlf
-.end:
-; pop ds
- ret
-
-
-; chkprn_syslinux
-chkprn_syslinux:
-%ifdef DEBUG
- mov si,may_sysl_str
- call writestr
-%endif
- cmp eax,59530000h
- jne .end
- cmp ebx,4C530000h
- jne .end
- cmp ecx,4E490000h
- jne .end
- cmp edx,58550000h
- jne .end
-.is_syslinux:
- pushad
-%ifdef DEBUG
- mov si,is_sysl_str
- call writestr
-%endif
-.get_sysl_ver:
- mov ax,0001h
- int 22h
-; AX=0001h [2.00] Get Version
-;
-; Input: AX 0001h
-; Output: AX number of INT 22h API functions available
-; CH Syslinux major version number
-; CL Syslinux minor version number
-; DL Syslinux derivative ID (e.g. 32h = PXELINUX)
-; ES:SI Syslinux version string
-; ES:DI Syslinux copyright string
-%ifdef DEBUG
- push si
- push cs
- pop ds
- mov si,gotver_str
- call writestr
- pop si
-%endif
-
-.prn_ver_str:
- mov si,syslban_str
- call writestr
- push ds
- push es
- pop ds
- call writestr
- call crlf
- pop ds
-.prn_var:
- cmp dl,31h
- je .var_sysl
- cmp dl,32h
- je .var_pxel
- cmp dl,33h
- je .var_isol
- cmp dl,34h
- je .var_extl
- jmp .var_unk
-.var_sysl:
- mov si,sysl_str
- call writestr
- jmp .prn_lnxsp
-.var_pxel:
- mov si,pxel_str
- call writestr
- jmp .prn_lnxsp
-.var_isol:
- mov si,isol_str
- call writestr
- jmp .prn_lnxsp
-.var_extl:
- mov si,extl_str
- call writestr
-; jmp .prn_lnxsp
-.prn_lnxsp:
- mov si,linsp_str
- call writestr
- jmp .prn_ver
-.var_unk:
- mov si,unkvar_str
- call writestr
-.prn_ver:
-%ifdef DEBUG
- push si
- push cs
- pop ds
- mov si,prn_ver_str
- call writestr
- pop si
-%endif
-.prn_ver_maj:
- mov al,ch
- call writedecb
- mov dl,'.'
- call writechr_dl
-.prn_ver_min:
- mov al,cl
-; cmp al,10
-; jae .min_wri
-; mov al,'0'
-; call writechr
-; mov al,cl
-; .min_wri:
-; call writedecb
- call writedecb2
-
-.end_prn:
- popad
-.end:
- ret
-
-; chkprn_dosver Check and print DOS version;
-; Input Data from INT21 AH=30h
-; AH Major version of DOS or 0
-; AL Minor Version
-; BH DOS type
-; BL:CX 24-bit OEM serial number
-; Return
-; ZF Unset if DOS, Set if not DOS (AX=0)
-chkprn_dosver:
- and ax,ax ; cmp ax,0
- jz .end
-.is_dos:
- push eax
- push edx
- push si
-%ifdef DEBUG
- mov si,is_dos_str
- call writestr
- call crlf
- call prnreg_gp_l
- call crlf
-%endif
-.var_prn:
- cmp bh,0
- je .var_pcdos
- cmp bh,0FFh
- je .var_msdos
- cmp bh,0FDh
- je .var_freedos
- cmp bh,0DEh
- je .var_drmk
- jmp .var_unk
-.var_pcdos:
- mov si,pcdos_str
- call writestr
- jmp .var_end
-.var_msdos:
- mov si,msdos_str
- call writestr
- jmp .var_end
-.var_freedos:
- mov si,freedos_str
- call writestr
- jmp .var_end
-.var_drmk:
- mov si,drmk_str
- call writestr
- jmp .var_end
-.var_unk:
- mov si,unkdos_str
- call writestr
- mov si,spparen_str
- call writestr
- push eax
- mov al,bh
- call writehex2
- pop eax
- mov si,parensp_str
- call writestr
-; jmp .var_end
-.var_end:
- call prn_dosver_num
- call crlf
-.subver:
- pop si
- pop edx
- pop eax
- cmp bh,0FFh
- je .msdos_ver
- cmp bh,0DEh
- jne .end_ver
-.drmk_ver:
- call getprn_drmkver
-; jmp .end_ver ; DRMK returns Extended/True DOS
-.msdos_ver:
- cmp al,5
- jb .end_ver
- call getprn_msdosver
-.end_ver:
- and ax,ax ; Unset ZF
-.end:
- ret
-
-; prn_dosver_num Print the numerical DOS version
-; Input Data from INT21 AH=30h
-; AH Major version of DOS or 0
-; AL Minor Version
-; BH DOS type
-; BL:CX 24-bit OEM serial number
-prn_dosver_num:
- push eax
- push edx
- push si
- pushfd
-.vmaj_prn:
- call writedecb
-; call writehex2
- mov dl,'.'
- call writechr_dl
-.vmin_prn:
- mov al,ah
- call writedecb
-; call writehex2
-.serial: ; Skip if 0
- cmp bl,0
- jne .ser_start
- cmp cx,0
- je .end
-.ser_start:
- mov si,spparen_str
- call writestr
- mov si,zerox_str
- call writestr
-.ser_bl:
- mov al,bl
- call writehex2
-.ser_cx:
- mov ax,cx
- call writehex4
-.serial_end:
- mov si,parensp_str
- call writestr
-.end:
- popfd
- pop si
- pop edx
- pop eax
- ret
-
-; getdosver Get the DOS version
-; Return Version or 0 + SYSLINUX message
-; EAX Part 1
-; EBX Part 2
-; ECX Part 3
-; EDX Part 4
-getdosver:
- mov ecx,0
- mov edx,0
- mov ebx,0
- mov eax,3000h
- int 21h
- ret
-
-; getmsdosver Get the Extended MS-DOS version
-; Returns Version
-; EAX Part 1
-; EBX Part 2
-; ECX Part 3
-; EDX Part 4
-getmsdosver:
- mov ecx,0
- mov edx,0
- mov ebx,0
- mov eax,3306h
- int 21h
- ret
-
-; getprn_msdosver
-getprn_msdosver:
- pushad
- pushfd
- call getmsdosver
-%ifdef DEBUG
- call prnreg_gp_l
- call crlf
-%endif
- mov si,dosext_str
- call writestr
- mov eax,ebx
- mov ebx,0
- mov ecx,edx
- call prn_dosver_num
-.end:
- popfd
- popad
- ret
-
-; getdrmkver: Get the DRMK-specifc OS version
-; Returns Version
-; AX OS Version
-; DX Patch Version
-getdrmkver:
- mov ax,4452h
- int 21h
- ret
-
-; getdrmkver: Get the DRMK-specifc Kernel build info
-; Returns Kernel build info
-; AX Kernel build date in DOS 16-bit format
-; [ES:BX] Kernel private data
-getdrmkbld:
- mov ax,4458h
- int 21h
- ret
-
-; getprn_drmkver: Get/Print DRMK-specific Version info
-getprn_drmkver:
- pushad
- pushfd
-.getver:
- call getdrmkver
-.prnosver: ; "OS Version"
- mov si,osver_str
- call writestr
- mov si,zerox_str
- call writestr
-; mov ax,0
- call writehex4
- call crlf
-.prnpatchver: ; "Patch Version"
- mov si,patchver_str
- call writestr
- mov si,zerox_str
- call writestr
- mov ax,dx
- call writehex4
- call crlf
-.getbld:
- call getdrmkbld
-.prnkernbld: ; "Kernel Build Date"
- mov si,kernbld_str
- call writestr
- call writedate_ax
- call crlf
-.prnkernprvaddr:
- mov si,prvdat_str
- call writestr
- mov ax,es
- call writehex4
- mov dl,':'
- call writechr_dl
- mov ax,bx
- call writehex4
- call crlf
-%ifdef DEBUG
-.prnkernprv:
- mov di,[es:bx]
- mov ax,di
- call writehex4
- call crlf
- mov si,2
- mov cx,8
-.prnkernprv2:
- push cx
- mov cx,8
-.prnkernprv1:
- mov eax,[es:bx+si]
- call writehex8
- cmp cx,1
- jbe .prnkern0dash
- mov ax,'-'
- call writechr
-.prnkern0dash:
- add si,4
- sub di,4
- cmp di,0
- jbe .prnkernprvend
- loop .prnkernprv1
- call crlf
- pop cx
- loop .prnkernprv2
- jmp .end
-.prnkernprvend:
- pop cx
-%endif
-.end:
- popfd
- popad
- ret
-
-;writedate_ax Write a date in AX in ISO8601 big endian format
-; Input
-; AX Date in 16-bit DOS format
-; 2006-01-11
-; 0011010 0001 01011
-writedate_ax:
- pushad
- pushfd
- mov dx,ax
-%ifdef DEBUG
- call writehex4
- call crlf
-%endif
-.year:
- shr ax,9
- add ax,1980
- call writedecw
- mov al,'-'
- call writechr
- mov ax,dx
-.month:
- shr ax,5
- and ax,0Fh
-; cmp ax,10
-; jae .month_wri
-; mov cx,ax
-; mov ax,'0'
-; call writechr
-; mov ax,cx
-; .month_wri:
-; call writedecb
- call writedecb2
- mov al,'-'
- call writechr
- mov ax,dx
-.day:
- and ax,1Fh
-; cmp ax,10
-; jae .day_wri
-; mov cx,ax
-; mov ax,'0'
-; call writechr
-; mov ax,cx
-; .day_wri:
-; call writedecb
- call writedecb2
-.end:
- popfd
- popad
- ret
-
-; writechr_dl Write a character to the console saving AX
-; Input
-; DL character to write
-writechr_dl:
- push ax
- mov ah,02h
- int 21h
-.end:
- pop ax
- ret
-
-; writechr_al Write a character to the console saving AX
-; Input
-; AL character to write
-writechr:
-writechr_al:
- push dx
- mov dl,al
- call writechr_dl
-.end: pop dx
- ret
-
-; writedecb[23] Print byte as fixed width
-; Input
-; AL number to write
-writedecb3:
- pushfd
- cmp al,100
- jae .skip
- push ax
- mov ax,'0'
- call writechr
- pop ax
-.skip: popfd
-writedecb2:
- pushfd
- cmp al,10
- jae .skip
- push ax
- mov ax,'0'
- call writechr
- pop ax
-.skip: popfd
- call writedecb
- ret
-
-
-; prnreg_gp_l Dump GP registers (Long)
-prnreg_gp_l:
- push eax
- push si
- call crlf
- mov si,sp2_str
- call writestr
- mov si,eax_str
- call writestr
- call writehex8
- mov si,sp2_str
- call writestr
- mov si,ecx_str
- call writestr
- mov eax,ecx
- call writehex8
- mov si,sp2_str
- call writestr
- mov si,edx_str
- call writestr
- mov eax,edx
- call writehex8
- mov si,sp2_str
- call writestr
- mov si,ebx_str
- call writestr
- mov eax,ebx
- call writehex8
- call crlf
- pop si
- pop eax
-.end:
- ret
-
-; is_zf
-is_zf:
- push si
- jz .true
-.false:
- mov si,zero_not_str
- call writestr
- jmp .end
-.true:
- mov si,zero_is_str
- call writestr
-.end:
- pop si
- ret
-
-%include "../core/macros.inc" ; CR/LF
-%include "writestr.inc" ; String output
-%include "../core/writehex.inc" ; Hexadecimal output
-%include "../core/writedec.inc" ; Decimal output
-
- section .data
-info_str db 'Ver.com b026', CR, LF, 0
-is_dos_str db 'Found DOS', CR, LF, 0
-is_sysl_str db 'Found a Syslinux variant', CR, LF, 0
-is_drmk_str db 'Found DRMK', CR, LF, 0
-may_sysl_str db 'Maybe Syslinux variant', CR, LF, 0
-gotver_str db 'Got the version back', CR, LF, 0
-prn_ver_str db 'Printing version number', CR, LF, 0
-syslban_str db 'Syslinux banner: ',0
-sysl_str db 'SYS', 0
-pxel_str db 'PXE', 0
-isol_str db 'ISO', 0
-extl_str db 'EXT', 0
-linsp_str db 'LINUX ', 0
-unkvar_str db 'Unkown-Variant ', 0
-pcdos_str db 'PC-DOS ', 0
-msdos_str db 'MS-DOS ', 0
-freedos_str db 'FreeDOS ', 0
-unkdos_str db 'Unknown-DOS ', 0
-drmk_str db 'DRMK ', 0
-dosext_str db ' Extended DOS version: ', 0
-osver_str db ' OS Version: ', 0
-patchver_str db ' Patch Version: ', 0
-kernbld_str db ' Kernel Build Date: ', 0
-prvdat_str db ' Private Data Ptr: ', 0
-spparen_str db ' (', 0
-zerox_str db '0x', 0
-parensp_str db ') ', 0
-eax_str db 'EAX=', 0
-ebx_str db 'EBX=', 0
-ecx_str db 'ECX=', 0
-edx_str db 'EDX=', 0
-sp2_str db ' ', 0
-zero_not_str db ' NOT_Zero ',0
-zero_is_str db ' IS_Zero ',0
diff --git a/modules/writestr.inc b/modules/writestr.inc
deleted file mode 100644
index 9c11b320..00000000
--- a/modules/writestr.inc
+++ /dev/null
@@ -1,47 +0,0 @@
-;; -----------------------------------------------------------------------
-;;
-;; Copyright 1994-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.
-;;
-;; -----------------------------------------------------------------------
-
-;;
-;; writestr.inc
-;;
-;; Code to write a simple string.
-;;
-
-;
-; crlf: Print a newline
-;
-crlf: push ax
- mov al,CR
- call writechr
- mov al,LF
- call writechr
- pop ax
- ret
-
-;
-; writestr: write a null-terminated string to the console, saving
-; registers on entry.
-;
-; Note: writestr_early and writestr are distinct in
-; SYSLINUX and EXTLINUX, but not PXELINUX and ISOLINUX
-;
-writestr:
- pushfd
- pushad
-.top: lodsb
- and al,al
- jz .end
- call writechr
- jmp short .top
-.end: popad
- popfd
- ret