aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFeng Tang <feng.tang@intel.com>2010-06-03 13:22:51 +0800
committerFeng Tang <feng.tang@intel.com>2010-07-20 11:10:03 +0800
commit58ddf011b33b45676ad8436ae870fa7050c0a228 (patch)
treeebf10570d8c52053694da1b8825c2594a6583e1c
parent70aa5968a72030aff10fbdb1cb2c1c6c08de5fec (diff)
downloadsyslinux-58ddf011b33b45676ad8436ae870fa7050c0a228.tar.gz
syslinux-58ddf011b33b45676ad8436ae870fa7050c0a228.tar.xz
syslinux-58ddf011b33b45676ad8436ae870fa7050c0a228.zip
elflink: before chang core/Makefile back
-rw-r--r--MCONFIG1
-rw-r--r--core/Makefile13
-rw-r--r--core/diskfs.inc6
-rw-r--r--core/extern.inc20
-rw-r--r--core/ui.inc26
5 files changed, 56 insertions, 10 deletions
diff --git a/MCONFIG b/MCONFIG
index c76b5917..21777188 100644
--- a/MCONFIG
+++ b/MCONFIG
@@ -49,6 +49,7 @@ gcc_ok = $(shell tmpf=gcc_ok.$$$$.tmp; \
LD = ld
OBJDUMP = objdump
OBJCOPY = objcopy
+STRIP = strip
AR = ar
NM = nm
RANLIB = ranlib
diff --git a/core/Makefile b/core/Makefile
index 166f0e4e..66b3fe66 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -50,7 +50,9 @@ COBJ := $(patsubst %.c,%.o,$(CSRC))
SOBJ := $(patsubst %.S,%.o,$(SSRC))
LIB = libcore.a
-LIBS = $(LIB) $(com32)/lib/libcomcore.a $(LIBGCC)
+#LIBS = $(LIB) $(com32)/lib/libcomcore.a $(LIBGCC)
+LIBS = $(LIB) $(LIBGCC) --whole-archive $(com32)/lib/libcom32min.a
+LIBDEP = $(filter-out -% %start%,$(LIBS))
LIBOBJS = $(COBJ) $(SOBJ)
NASMDEBUG = -g -F dwarf
@@ -88,9 +90,12 @@ kwdhash.gen: keywords genhash.pl
-DHEXDATE="$(HEXDATE)" \
-l $(@:.o=.lsr) -o $@ -MP -MD .$@.d $<
-%.elf: %.o $(LIBS) syslinux.ld
- $(LD) $(LDFLAGS) -T syslinux.ld -M -o $@ $< \
- --start-group $(LIBS) --end-group \
+#%.elf: %.o $(LIBS) syslinux.ld
+# $(LD) $(LDFLAGS) -T syslinux.ld -M -o $@ $< \
+# --start-group $(LIBS) --end-group \
+%.elf: %.o $(LIBDEP) syslinux.ld
+ $(LD) $(LDFLAGS) -Bsymbolic -pie -E --hash-style=gnu \
+ -T syslinux.ld -M -o $@ $< $(LIBS) \
> $(@:.elf=.map)
$(OBJDUMP) -h $@ > $(@:.elf=.sec)
$(PERL) lstadjust.pl $(@:.elf=.lsr) $(@:.elf=.sec) $(@:.elf=.lst)
diff --git a/core/diskfs.inc b/core/diskfs.inc
index 9f18c765..19a46cc2 100644
--- a/core/diskfs.inc
+++ b/core/diskfs.inc
@@ -97,13 +97,15 @@ trackbuf resb trackbufsize ; Track buffer goes here
;
; Load configuration file
;
- pm_call load_config
- jz no_config_file
+ ;feng
+ ;pm_call load_config
+ ;jz no_config_file
;
; Now we have the config file open. Parse the config file and
; run the user interface.
;
+ pm_call hello
%include "ui.inc"
;
diff --git a/core/extern.inc b/core/extern.inc
index 64edea61..6bbc78cf 100644
--- a/core/extern.inc
+++ b/core/extern.inc
@@ -9,6 +9,26 @@
; rllpack.c
extern rllpack, rllunpack
+ ; hello.c
+ extern hello
+
+ ;abort.c
+ extern abort_load_new
+
+ ; elflink/load_env32.c
+ extern load_env32, enter_cmdline
+
+ ; memscan.c
+ extern highmem_init
+
+ extern linux_kernel
+
+ extern mp1, mp2, mp3, mp4, mp5
+
+ extern hexdump, mydump
+
+ extern printf_init
+
; fs.c
extern fs_init, pm_searchdir, getfssec, getfsbytes
extern pm_mangle_name, load_config
diff --git a/core/ui.inc b/core/ui.inc
index 2d44447d..41e6fbac 100644
--- a/core/ui.inc
+++ b/core/ui.inc
@@ -14,6 +14,17 @@
;
; This file should be entered with the config file open (for getc)
;
+%if 1
+;on_error:
+no_config_file:
+enter_command:
+auto_boot:
+load_kernel:
+kernel_good_saved:
+ pm_call hello
+ pm_call enter_cmdline ; Never return
+
+%else ; comment off the original ui.inc
load_config_file:
call parse_config ; Parse configuration file
no_config_file:
@@ -585,10 +596,6 @@ getchar_timeout:
;
; Anything else is assumed to be a Linux kernel.
;
- section .bss16
- alignb 4
-Kernel_EAX resd 1
-Kernel_SI resw 1
section .text16
kernel_good_saved:
@@ -689,6 +696,14 @@ is_bss_sector equ is_bad_image
is_disk_image equ is_bad_image
%endif
+%endif ; start of replacing ui.inc
+
+ section .bss16
+ alignb 4
+Kernel_EAX resd 1
+Kernel_SI resw 1
+
+
section .data16
boot_prompt db 'boot: ', 0
wipe_char db BS, ' ', BS, 0
@@ -697,6 +712,7 @@ err_notfound db 'Could not find kernel image: ',0
err_notkernel db CR, LF, 'Invalid or corrupt kernel image.', CR, LF, 0
+%if 0
alignz 2
kerneltype_table:
dw is_unknown_filetype ; VK_KERNEL
@@ -708,8 +724,10 @@ kerneltype_table:
dw is_comboot_image ; VK_COMBOOT
dw is_com32_image ; VK_COM32
dw is_config_file ; VK_CONFIG
+%endif
section .bss16
+ global CmdOptPtr
alignb 4
ThisKbdTo resd 1 ; Temporary holder for KbdTimeout
ThisTotalTo resd 1 ; Temporary holder for TotalTimeout