diff options
author | hpa <hpa> | 2004-12-29 19:34:13 +0000 |
---|---|---|
committer | hpa <hpa> | 2004-12-29 19:34:13 +0000 |
commit | 534a0acb863f44aebbc4248f5ad36485bb7086d9 (patch) | |
tree | 1bbe67198bbe60c57c13166963706a3d345d381a /memdisk | |
parent | c65fc8ea4fbdf9ccb964a33362d19853fca5ca0c (diff) | |
download | syslinux-534a0acb863f44aebbc4248f5ad36485bb7086d9.tar.gz |
Add boot loader ID to the memdisk info structure
Diffstat (limited to 'memdisk')
-rw-r--r-- | memdisk/memdisk.asm | 5 | ||||
-rw-r--r-- | memdisk/memdisk.doc | 6 | ||||
-rw-r--r-- | memdisk/setup.c | 11 |
3 files changed, 17 insertions, 5 deletions
diff --git a/memdisk/memdisk.asm b/memdisk/memdisk.asm index 7acb3cb5..3c33120f 100644 --- a/memdisk/memdisk.asm +++ b/memdisk/memdisk.asm @@ -697,7 +697,7 @@ Mover_dummy2: dd 0, 0, 0, 0 ; More space for the BIOS alignb 4, db 0 MemDisk_Info equ $ ; Pointed to by installation check -MDI_Bytes dw 26 ; Total bytes in MDI structure +MDI_Bytes dw 27 ; Total bytes in MDI structure MDI_Version db VER_MINOR, VER_MAJOR ; MEMDISK version PatchArea equ $ ; This gets filled in by the installer @@ -710,7 +710,10 @@ OldInt13 dd 0 ; INT 13h in chain OldInt15 dd 0 ; INT 15h in chain OldDosMem dw 0 ; Old position of DOS mem end +BootLoaderID db 0 ; Boot loader ID from header ; ---- MDI structure ends here --- + db 0, 0, 0 ; pad + MemInt1588 dw 0 ; 1MB-65MB memory amount (1K) Cylinders dw 0 ; Cylinder count diff --git a/memdisk/memdisk.doc b/memdisk/memdisk.doc index b67355e2..91e9b3a0 100644 --- a/memdisk/memdisk.doc +++ b/memdisk/memdisk.doc @@ -125,7 +125,7 @@ http://www.ctyme.com/rbrown.htm, for a detailed description. The MEMDISK info structure currently contains: - [ES:DI] word Total size of structure (currently 26 bytes) + [ES:DI] word Total size of structure (currently 27 bytes) [ES:DI+2] byte MEMDISK minor version [ES:DI+3] byte MEMDISK major version [ES:DI+4] dword Pointer to MEMDISK data in high memory @@ -134,6 +134,10 @@ The MEMDISK info structure currently contains: [ES:DI+16] 16:16 Old INT 13h pointer [ES:DI+20] 16:16 Old INT 15h pointer [ES:DI+24] word Amount of DOS memory before MEMDISK loaded + [ES:DI+26] byte Boot loader ID + +MEMDISK 3.00 and higher has the size of this structure as 27; earlier +versions had size 26 and did not include the boot loader ID. In addition, the following fields are available at [ES:0]: diff --git a/memdisk/setup.c b/memdisk/setup.c index 52754872..f0dd0f4b 100644 --- a/memdisk/setup.c +++ b/memdisk/setup.c @@ -70,6 +70,9 @@ struct patch_area { uint32_t oldint15; uint16_t olddosmem; + uint8_t bootloaderid; + + uint8_t _pad[3]; uint16_t memint1588; uint16_t cylinders; @@ -90,7 +93,7 @@ struct patch_area { uint16_t statusptr; dpt_t dpt; -}; +} __attribute__((packed)); /* This is the header in the boot sector/setup area */ struct setup_header { @@ -118,7 +121,7 @@ struct setup_header { uint16_t pad1; uint32_t cmd_line_ptr; uint32_t initrd_addr_max; -}; +} __attribute__((packed)); const struct setup_header * const shdr = (struct setup_header *)(LOW_SEG << 4); @@ -571,8 +574,10 @@ uint32_t setup(syscall_t cs_syscall, void *cs_bounce) pptr->disksize = geometry->sectors; pptr->diskbuf = ramdisk_image + geometry->offset; pptr->statusptr = (geometry->driveno & 0x80) ? 0x474 : 0x441; - pptr->configflags = 0; + pptr->bootloaderid = shdr->type_of_loader; + + pptr->configflags = 0; /* Set config flags */ if ( getcmditem("ro") != CMD_NOTFOUND ) { puts("Marking disk readonly\n"); |