summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/Makefile11
-rw-r--r--core/head.inc1
-rw-r--r--core/pxeboot.c40
-rw-r--r--core/pxelinux.asm21
-rw-r--r--core/vkernel.inc35
5 files changed, 66 insertions, 42 deletions
diff --git a/core/Makefile b/core/Makefile
index eaf12443..f795a5c8 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -68,7 +68,8 @@ LPXELINUX_OBJS = $(subst $(SRC)/,,$(LPXELINUX_CSRC:%.c=%.o))
PXELINUX_OBJS = $(subst $(SRC)/,,$(PXELINUX_CSRC:%.c=%.o))
# Don't include console and network stack specific objects
-FILTER_OBJS = %rawcon.o %plaincon.o %pxelinux-c.o %ldlinux-c.o %isolinux-c.o \
+FILTER_OBJS = %rawcon.o %plaincon.o %pxelinux-c.o %ldlinux-c.o \
+ %isolinux-c.o %localboot.o %pxeboot.o \
$(subst $(OBJ)/,,$(LPXELINUX_OBJS)) \
$(subst $(OBJ)/,,$(PXELINUX_OBJS))
@@ -163,7 +164,7 @@ LDSCRIPT = $(SRC)/$(ARCH)/syslinux.ld
$(OBJDUMP) -h $@ > $(@:.elf=.sec)
$(PERL) $(SRC)/lstadjust.pl $(@:.elf=.lsr) $(@:.elf=.sec) $(@:.elf=.lst)
-libisolinux.a: rawcon.o isolinux-c.o
+libisolinux.a: rawcon.o localboot.o isolinux-c.o
rm -f $@
$(AR) cq $@ $^
$(RANLIB) $@
@@ -172,18 +173,18 @@ libisolinux-debug.a: libisolinux.a
cp $^ $@
# Legacy network stack
-libpxelinux.a: rawcon.o pxelinux-c.o $(PXELINUX_OBJS)
+libpxelinux.a: rawcon.o pxeboot.o pxelinux-c.o $(PXELINUX_OBJS)
rm -f $@
$(AR) cq $@ $^
$(RANLIB) $@
# LwIP network stack
-liblpxelinux.a: rawcon.o pxelinux-c.o $(LPXELINUX_OBJS)
+liblpxelinux.a: rawcon.o pxeboot.o pxelinux-c.o $(LPXELINUX_OBJS)
rm -f $@
$(AR) cq $@ $^
$(RANLIB) $@
-libldlinux.a: plaincon.o ldlinux-c.o
+libldlinux.a: plaincon.o localboot.o ldlinux-c.o
rm -f $@
$(AR) cq $@ $^
$(RANLIB) $@
diff --git a/core/head.inc b/core/head.inc
index 286b9b4e..71eb5744 100644
--- a/core/head.inc
+++ b/core/head.inc
@@ -34,6 +34,5 @@
%include "tracers.inc"
%include "stack.inc"
%include "io.inc"
-%include "vkernel.inc"
%endif ; _HEAD_INC
diff --git a/core/pxeboot.c b/core/pxeboot.c
new file mode 100644
index 00000000..b6c90998
--- /dev/null
+++ b/core/pxeboot.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright 1994-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
+ * 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.
+ */
+
+#include <syslinux/video.h>
+#include "pxe.h"
+#include <com32.h>
+
+#define LOCALBOOT_MSG "Booting from local disk..."
+
+extern void local_boot16(void);
+
+/*
+ * Boot to the local disk by returning the appropriate PXE magic.
+ * AX contains the appropriate return code.
+ */
+__export void local_boot(uint16_t ax)
+{
+ com32sys_t ireg;
+
+ syslinux_force_text_mode();
+
+ writestr(LOCALBOOT_MSG);
+ crlf();
+
+ /* Restore the environment we were called with */
+ reset_pxe();
+
+ cleanup_hardware();
+
+ ireg.eax.w[0] = ax;
+ call16(local_boot16, &ireg, NULL);
+}
diff --git a/core/pxelinux.asm b/core/pxelinux.asm
index 185b90f1..3e2bc0a1 100644
--- a/core/pxelinux.asm
+++ b/core/pxelinux.asm
@@ -289,7 +289,26 @@ KernelName resb FILENAME_MAX ; Mangled name for kernel
; Hardware cleanup common code
;
-%include "localboot.inc"
+ section .text16
+ global local_boot16:function hidden
+local_boot16:
+ mov [LocalBootType],ax
+ lss sp,[InitStack]
+ pop gs
+ pop fs
+ pop es
+ pop ds
+ popad
+ mov ax,[cs:LocalBootType]
+ cmp ax,-1 ; localboot -1 == INT 18h
+ je .int18
+ popfd
+ retf ; Return to PXE
+.int18:
+ popfd
+ int 18h
+ jmp 0F000h:0FFF0h
+ hlt
;
; kaboom: write a message and bail out. Wait for quite a while,
diff --git a/core/vkernel.inc b/core/vkernel.inc
deleted file mode 100644
index 278344e4..00000000
--- a/core/vkernel.inc
+++ /dev/null
@@ -1,35 +0,0 @@
-;; -----------------------------------------------------------------------
-;;
-;; Copyright 1994-2008 H. Peter Anvin - All Rights Reserved
-;; Copyright 2009-2011 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
-;; the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
-;; Boston MA 02110-1301, USA; either version 2 of the License, or
-;; (at your option) any later version; incorporated herein by reference.
-;;
-;; -----------------------------------------------------------------------
-
-%ifndef _VKERNEL_INC
-%define _VKERNEL_INC
-
-;
-; The following structure is used for "virtual kernels"; i.e. LILO-style
-; option labels. The options we permit here are `kernel' and `append
-; Since there is no room in the bottom 64K for all of these, we
-; stick them in high memory and copy them down before we need them.
-;
- struc vkernel
-vk_vname: resb FILENAME_MAX ; Virtual name **MUST BE FIRST!**
-vk_rname: resb FILENAME_MAX ; Real name
-vk_sysappend: resd 1 ; Sysappend option
-vk_appendlen: resw 1
-vk_type: resb 1 ; Type of file
- alignb 4
-vk_append: resb max_cmd_len+1 ; Command line
- alignb 4
-vk_end: equ $ ; Should be <= vk_size
- endstruc
-
-%endif ; _VKERNEL_INC