aboutsummaryrefslogtreecommitdiffstats
path: root/com32/modules
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-04-11 10:46:38 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-04-11 10:46:38 -0700
commit51c43d5e58b0f88a2392102015c089109307fa9b (patch)
tree059e8925ccb5410145c1c823f6a8f8d956ef3002 /com32/modules
parent55de9cbffb0377dec13860a4aeb7a66e4c2b500e (diff)
parent3b80c2699cde4e159bc9af15308c480acf2c836d (diff)
downloadsyslinux.git-51c43d5e58b0f88a2392102015c089109307fa9b.tar.gz
syslinux.git-51c43d5e58b0f88a2392102015c089109307fa9b.tar.xz
syslinux.git-51c43d5e58b0f88a2392102015c089109307fa9b.zip
Merge branch 'master' into for-erwan
Conflicts: com32/hdt/Makefile
Diffstat (limited to 'com32/modules')
-rw-r--r--com32/modules/Makefile3
-rw-r--r--com32/modules/chain.c77
-rw-r--r--com32/modules/kbdmap.c2
3 files changed, 10 insertions, 72 deletions
diff --git a/com32/modules/Makefile b/com32/modules/Makefile
index 305ea49f..ba76268f 100644
--- a/com32/modules/Makefile
+++ b/com32/modules/Makefile
@@ -1,6 +1,7 @@
## -----------------------------------------------------------------------
##
## Copyright 2001-2009 H. Peter Anvin - All Rights Reserved
+## Copyright 2009 Intel Corporation; author: 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
@@ -53,6 +54,6 @@ spotless: clean
rm -f *.lss *.c32 *.com
rm -f *~ \#*
-install: all
+install:
-include .*.d
diff --git a/com32/modules/chain.c b/com32/modules/chain.c
index 979ede2d..ead908f2 100644
--- a/com32/modules/chain.c
+++ b/com32/modules/chain.c
@@ -1,6 +1,7 @@
/* ----------------------------------------------------------------------- *
*
- * Copyright 2003-2008 H. Peter Anvin - All Rights Reserved
+ * Copyright 2003-2009 H. Peter Anvin - All Rights Reserved
+ * Copyright 2009 Intel Corporation; author: 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
@@ -446,79 +447,15 @@ static void do_boot(void *boot_sector, size_t boot_size,
return;
}
- if (loadbase < 0x7c00) {
- /* Special hack: if we are to be loaded below 0x7c00, we need to handle
- the part that goes below 0x7c00 specially, since that's where the
- shuffler lives. To deal with that, stuff the balance at the end
- of low memory and put a small copy stub there.
-
- The only tricky bit is that we need to set up registers for our
- move, and then restore them to what they should be at the end of
- the code. */
- static uint8_t copy_down_code[] = {
- 0xf3,0x66,0xa5, /* 00: rep movsd */
- 0xbe,0,0, /* 03: mov si,0 */
- 0xbf,0,0, /* 06: mov di,0 */
- 0x8e,0xde, /* 09: mov ds,si */
- 0x8e,0xc7, /* 0b: mov es,di */
- 0x66,0xb9,0,0,0,0, /* 0d: mov ecx,0 */
- 0x66,0xbe,0,0,0,0, /* 13: mov esi,0 */
- 0x66,0xbf,0,0,0,0, /* 19: mov edi,0 */
- 0xea,0,0,0,0, /* 1f: jmp 0:0 */
- /* pad out to segment boundary */
- 0x90,0x90,0x90,0x90, /* 24: ... */
- 0x90,0x90,0x90,0x90, /* 28: ... */
- 0x90,0x90,0x90,0x90, /* 2c: ... */
- };
- size_t low_size = min(boot_size, 0x7c00-loadbase);
- size_t high_size = boot_size - low_size;
- size_t low_addr = (0x7c00 + high_size + 15) & ~15;
- size_t move_addr = (low_addr + low_size + 15) & ~15;
- const size_t move_size = sizeof copy_down_code;
-
- if (move_addr+move_size >= dosmem-0x7c00)
- goto too_big;
-
- *(uint16_t *)&copy_down_code[0x04] = regs->ds;
- *(uint16_t *)&copy_down_code[0x07] = regs->es;
- *(uint32_t *)&copy_down_code[0x0f] = regs->ecx.l;
- *(uint32_t *)&copy_down_code[0x15] = regs->esi.l;
- *(uint32_t *)&copy_down_code[0x1b] = regs->edi.l;
- *(uint16_t *)&copy_down_code[0x20] = regs->ip;
- *(uint16_t *)&copy_down_code[0x22] = regs->cs;
-
- regs->ecx.l = (low_size+3) >> 2;
- regs->esi.l = 0;
- regs->edi.l = loadbase & 15;
- regs->ds = low_addr >> 4;
- regs->es = loadbase >> 4;
- regs->cs = move_addr >> 4;
- regs->ip = 0;
-
- endimage = move_addr + move_size;
-
- if (high_size)
- if (syslinux_add_movelist(&mlist, 0x7c00,
- (addr_t)boot_sector+low_size, high_size))
- goto enomem;
- if (syslinux_add_movelist(&mlist, low_addr,
- (addr_t)boot_sector, low_size))
- goto enomem;
- if (syslinux_add_movelist(&mlist, move_addr,
- (addr_t)copy_down_code, move_size))
- goto enomem;
- } else {
- /* Nothing below 0x7c00, much simpler... */
+ /* Nothing below 0x7c00, much simpler... */
- if (boot_size >= dosmem-0x7c00)
+ if (boot_size >= dosmem - loadbase)
goto too_big;
- endimage = loadbase + boot_size;
+ endimage = loadbase + boot_size;
- if (syslinux_add_movelist(&mlist, loadbase, (addr_t)boot_sector,
- boot_size))
- goto enomem;
- }
+ if (syslinux_add_movelist(&mlist, loadbase, (addr_t)boot_sector, boot_size))
+ goto enomem;
if (opt.swap && driveno != swapdrive) {
static const uint8_t swapstub_master[] = {
diff --git a/com32/modules/kbdmap.c b/com32/modules/kbdmap.c
index 866acfc2..7e36a35d 100644
--- a/com32/modules/kbdmap.c
+++ b/com32/modules/kbdmap.c
@@ -1,6 +1,6 @@
/* ----------------------------------------------------------------------- *
*
- * Copyright 2009 H. Peter Anvin - All Rights Reserved
+ * Copyright 2009 Intel Corporation; author: 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