diff options
author | hpa <hpa> | 2005-04-29 06:04:45 +0000 |
---|---|---|
committer | hpa <hpa> | 2005-04-29 06:04:45 +0000 |
commit | 5f64a1decec0d6bd4408a5b7a51ce05453f0b6f1 (patch) | |
tree | 254403b7fabbb390bc18ecdcb2ce292e42b87f7c /memdisk | |
parent | d7f4c9ccc164f1db8693bd8010a06d50de0c8f77 (diff) | |
download | syslinux-5f64a1decec0d6bd4408a5b7a51ce05453f0b6f1.tar.gz |
Add new "bigraw" mode to memdisk.
Diffstat (limited to 'memdisk')
-rw-r--r-- | memdisk/memdisk.asm | 33 | ||||
-rw-r--r-- | memdisk/memdisk.doc | 6 | ||||
-rw-r--r-- | memdisk/setup.c | 5 |
3 files changed, 32 insertions, 12 deletions
diff --git a/memdisk/memdisk.asm b/memdisk/memdisk.asm index 3c33120f..fc2c736c 100644 --- a/memdisk/memdisk.asm +++ b/memdisk/memdisk.asm @@ -37,6 +37,10 @@ %endif ; DEBUG_TRACERS +%define CONFIG_READONLY 0x01 +%define CONFIG_RAW 0x02 +%define CONFIG_BIGRAW 0x08 ; MUST be 8! + org 0h %define SECTORSIZE_LG2 9 ; log2(sector size) @@ -242,7 +246,7 @@ WriteMult: TRACER 'M' Write: TRACER 'W' - test byte [ConfigFlags],01h + test byte [ConfigFlags],CONFIG_READONLY jnz .readonly call setup_regs xchg esi,edi ; Opposite direction of a Read! @@ -448,7 +452,7 @@ bcopy: push edx push ebp - test byte [ConfigFlags],02h + test byte [ConfigFlags],CONFIG_RAW jz .anymode smsw ax ; Unprivileged! @@ -489,24 +493,32 @@ bcopy: mov [0],ax or dx,bx + push dx ; Save A20 status jnz .skip_a20e mov ax,2401h ; Enable A20 int 15h .skip_a20e: + mov dl,[ConfigFlags] + and dx,CONFIG_BIGRAW + add dx,8 + ; DX = 16 for BIGRAW, 8 for RAW + ; 8 is selector for a 64K flat segment, + ; 16 is selector for a 4GB flat segment. lgdt [cs:Shaker] mov eax,cr0 or al,01h mov cr0,eax - mov bx,8 - mov ds,bx - mov es,bx + mov ax,16 ; Large flag segment + mov ds,ax + mov es,ax a32 rep movsd - add bx,bx ; BX <- 16 + ; DX has the appropriate value to put in + ; the registers on return mov ds,bx mov es,bx @@ -516,6 +528,7 @@ bcopy: pop es pop ds + pop dx ; A20 status and dx,dx jnz .skip_a20d mov ax,2400h ; Disable A20 @@ -671,12 +684,12 @@ Shaker dw ShakerEnd-$ dd 0 ; Pointer to self dw 0 -Shaker_DS: dd 0x0000ffff - dd 0x008f9300 - -Shaker_RMDS: dd 0x0000ffff +Shaker_RMDS: dd 0x0000ffff ; 64K data segment dd 0x00009300 +Shaker_DS: dd 0x0000ffff ; 4GB data segment + dd 0x008f9300 + ShakerEnd equ $ alignb 8, db 0 diff --git a/memdisk/memdisk.doc b/memdisk/memdisk.doc index 91e9b3a0..b8fbfb07 100644 --- a/memdisk/memdisk.doc +++ b/memdisk/memdisk.doc @@ -72,11 +72,13 @@ d) MEMDISK normally uses the BIOS "INT 15h mover" API to access high memory. This is well-behaved with extended memory managers which load later. Unfortunately it appears that the "DOS boot disk" from WinME/XP *deliberately* crash the system when this API is invoked. - The following command-line option tells MEMDISK to enter protected + The following command-line options tells MEMDISK to enter protected mode directly, whenever possible: - raw Use raw access to protected mode memory + raw Use raw access to protected mode memory. + bigraw Use raw access to protected mode memory, and leave the + CPU in "big real" mode afterwards. Some interesting things to note: diff --git a/memdisk/setup.c b/memdisk/setup.c index f8de652a..559b1aaf 100644 --- a/memdisk/setup.c +++ b/memdisk/setup.c @@ -88,6 +88,7 @@ struct patch_area { uint8_t configflags; #define CONFIG_READONLY 0x01 #define CONFIG_RAW 0x02 +#define CONFIG_BIGRAW 0x08 /* MUST be 8! */ uint16_t mystack; uint16_t statusptr; @@ -587,6 +588,10 @@ uint32_t setup(syscall_t cs_syscall, void *cs_bounce) puts("Using raw access to high memory\n"); pptr->configflags |= CONFIG_RAW; } + if ( getcmditem("bigraw") != CMD_NOTFOUND ) { + puts("Using raw access to high memory - assuming big real mode\n"); + pptr->configflags |= CONFIG_BIGRAW|CONFIG_RAW; + } /* Set up a drive parameter table */ if ( geometry->driveno & 0x80 ) { |