Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec5863a7f5 | ||
|
|
9f7141a1ce | ||
|
|
4175b778c2 | ||
|
|
c9c411286a | ||
|
|
0fc13add31 | ||
|
|
d7dfc9572e | ||
|
|
a7290a970c | ||
|
|
2310c30d1c | ||
|
|
444d5550a7 | ||
|
|
4eab5bc8ca | ||
|
|
37a0aab4ff | ||
|
|
b3db99a38d | ||
|
|
d5d68b2e31 | ||
|
|
487347a0cd | ||
|
|
e5f14e5a32 | ||
|
|
0ff5c456cb | ||
|
|
965a0f7a75 | ||
|
|
a0d337912e | ||
|
|
0c30dc6bc5 | ||
|
|
8de49af0d2 | ||
|
|
419243e7f1 | ||
|
|
4be11f523c | ||
|
|
1175f0cf29 | ||
|
|
0b1222f233 | ||
|
|
cf716a0ce6 | ||
|
|
d944794680 | ||
|
|
976f12c501 | ||
|
|
04878ef745 | ||
|
|
46073f1239 | ||
|
|
ce68f587e2 | ||
|
|
3f274a6950 | ||
|
|
fc9750a68d | ||
|
|
0b3c88e035 | ||
|
|
1e810bebe9 | ||
|
|
f128a6db21 | ||
|
|
e6e30618c2 | ||
|
|
34bfc04e4c | ||
|
|
44251ebb9a | ||
|
|
0e07516f62 | ||
|
|
18bcdfb1cc | ||
|
|
7a3a159af5 | ||
|
|
ad66465b3c | ||
|
|
b0c563824b | ||
|
|
1f7d550246 | ||
|
|
70f47e675e | ||
|
|
993f8ba9bc | ||
|
|
5e1aa70301 | ||
|
|
193d545903 | ||
|
|
bba00b0c13 | ||
|
|
2b9f7f042c | ||
|
|
5552a1b202 | ||
|
|
f42b2932f8 | ||
|
|
b570c2efd8 | ||
|
|
96f4f96540 | ||
|
|
14ae602ef0 | ||
|
|
ce64398f87 | ||
|
|
bb2cf3c8d7 | ||
|
|
cd5a21359c | ||
|
|
de50a19ae3 | ||
|
|
dd2788594b | ||
|
|
cc2e767b5a | ||
|
|
c939bc57ff | ||
|
|
ea6eb7f7ed | ||
|
|
0095e18d4c | ||
|
|
773028d34e | ||
|
|
94876f4bb6 | ||
|
|
f1d92fa886 | ||
|
|
92cf240020 | ||
|
|
80c41b90d2 | ||
|
|
3f4972db9a | ||
|
|
0582a84e66 | ||
|
|
47c4aaa9e2 | ||
|
|
165074c188 | ||
|
|
8a852280eb | ||
|
|
cb9ef4dee2 | ||
|
|
63c112ed38 | ||
|
|
0fbf2f6bda | ||
|
|
3c77fe73a5 | ||
|
|
b4155c4ab5 | ||
|
|
8aa2591c06 | ||
|
|
06ad481904 | ||
|
|
4d0029611f | ||
|
|
d6b47871de | ||
|
|
1d8c85d112 | ||
|
|
365b8db5cf | ||
|
|
887d296b88 | ||
|
|
1f5c0239b4 | ||
|
|
7ba33f7826 | ||
|
|
b25a4b6c8a | ||
|
|
8868956268 | ||
|
|
d09290161e | ||
|
|
54ec3673cc | ||
|
|
acfd7cc609 | ||
|
|
1d8d8ef2c8 | ||
|
|
51172783e2 | ||
|
|
b7e93a6a55 | ||
|
|
546cc62394 | ||
|
|
76c915d5bd | ||
|
|
6e564323e0 | ||
|
|
ee1d315ac0 | ||
|
|
07b5be3341 | ||
|
|
c2965b0fe7 | ||
|
|
c26a38b313 | ||
|
|
f186ada2d3 | ||
|
|
9580f9d5cd | ||
|
|
15ce2fb851 | ||
|
|
6254998327 | ||
|
|
4125216a2f | ||
|
|
a310d00d37 | ||
|
|
cb9700ef6f | ||
|
|
4fe1e08a60 | ||
|
|
0b922595fe | ||
|
|
4f881ae352 | ||
|
|
ded4d3a703 | ||
|
|
198ae0a131 | ||
|
|
5e1ef98469 | ||
|
|
58f60df66c | ||
|
|
99e64f5806 | ||
|
|
f4605970f4 | ||
|
|
a2f753ba64 | ||
|
|
f8448735b0 | ||
|
|
254bdc2a8e | ||
|
|
eb3ca2a36f | ||
|
|
743ebc2f4b | ||
|
|
558c1a45fe | ||
|
|
68973f1c49 | ||
|
|
edfbd4e4fa | ||
|
|
4c5f00f879 | ||
|
|
5e51aaccaa | ||
|
|
a5cd8d1772 | ||
|
|
92a9978b44 | ||
|
|
8afafb6532 | ||
|
|
e47869995f | ||
|
|
1f80b2dcd5 | ||
|
|
b8469eddaa | ||
|
|
005fce0258 | ||
|
|
3c06277bbb | ||
|
|
822b3b53f4 | ||
|
|
c345336435 | ||
|
|
f51d61371f | ||
|
|
1958974d0a | ||
|
|
c5a88ed553 | ||
|
|
3961c1ca02 | ||
|
|
9119b0c8af | ||
|
|
f4bf4e69f7 | ||
|
|
c44a193d0d | ||
|
|
41307f2874 | ||
|
|
a525fb7782 | ||
|
|
a13fc96cb3 | ||
|
|
4188d51753 | ||
|
|
7c47ebd65c | ||
|
|
6e764282dd | ||
|
|
bb06fc17cc | ||
|
|
9b964dec36 | ||
|
|
4b8e021161 | ||
|
|
e960fac8d0 | ||
|
|
ad027e41e5 | ||
|
|
a1eb4ffdf7 | ||
|
|
ead44dba89 | ||
|
|
3d6b8a67f2 | ||
|
|
f721067d35 | ||
|
|
a63ef9207d | ||
|
|
f79608b376 | ||
|
|
b4a87daeb9 | ||
|
|
7aee624881 | ||
|
|
7741546a40 | ||
|
|
b363d19a16 | ||
|
|
cc4363acca | ||
|
|
38a1d0fe3f | ||
|
|
b149a99302 | ||
|
|
f44205b9ea | ||
|
|
dc387547a3 | ||
|
|
3dd7ce1c26 | ||
|
|
7266aceb39 | ||
|
|
820b11dc0a | ||
|
|
210bc9e9ba | ||
|
|
bbd274a1d6 | ||
|
|
e3b9e3d04b | ||
|
|
b0c818d7b5 | ||
|
|
f7d2168c8e | ||
|
|
edea441ad5 | ||
|
|
272e6ddc30 | ||
|
|
323cdf8c4c | ||
|
|
abc13af070 | ||
|
|
a436dc4014 | ||
|
|
a323a85d9b | ||
|
|
f3335b83d4 | ||
|
|
5538a38b9c | ||
|
|
03ff8cd3e2 | ||
|
|
3da6f1c7bd | ||
|
|
87b494bbab | ||
|
|
5bd32315d0 | ||
|
|
1c67623e37 | ||
|
|
16aa435567 | ||
|
|
90c01ef1e4 | ||
|
|
3c68ff99ea | ||
|
|
1266d7902b | ||
|
|
3ed468e0c5 | ||
|
|
4397a2a4ca | ||
|
|
f3d09b5c79 | ||
|
|
ec24672db7 | ||
|
|
f95c919741 |
@@ -47,13 +47,13 @@ To get qemu running is fairly simple:
|
||||
|
||||
8. Build gPXE floppy disk images and pad to 1.44MB
|
||||
pushd ../../src
|
||||
make bin/rtl8139.pdsk
|
||||
make bin/rtl8139.dsk
|
||||
popd
|
||||
|
||||
9. Start qemu
|
||||
./qemu/i386-softmmu/qemu -L qemu/pc-bios \
|
||||
-net nic,model=rtl8139 -net tap,ifname=tap0 \
|
||||
-boot a -fda ../../src/bin/rtl8139.pdsk
|
||||
-boot a -fda ../../src/bin/rtl8139.dsk
|
||||
|
||||
You should see qemu start up, load up gPXE and attempt to boot from
|
||||
the network.
|
||||
|
||||
+15
-3
@@ -22,7 +22,7 @@ ECHO := echo
|
||||
PRINTF := printf
|
||||
PERL := /usr/bin/perl
|
||||
CC := $(CROSS_COMPILE)gcc
|
||||
CPP := $(CROSS_COMPILE)gcc -E -Wp,-Wall
|
||||
CPP := $(CC) -E
|
||||
AS := $(CROSS_COMPILE)as
|
||||
LD := $(CROSS_COMPILE)ld
|
||||
SIZE := $(CROSS_COMPILE)size
|
||||
@@ -35,12 +35,17 @@ PARSEROM := $(PERL) ./util/parserom.pl
|
||||
MAKEROM := $(PERL) ./util/makerom.pl
|
||||
SYMCHECK := $(PERL) ./util/symcheck.pl
|
||||
SORTOBJDUMP := $(PERL) ./util/sortobjdump.pl
|
||||
PADIMG := $(PERL) ./util/padimg.pl
|
||||
LICENCE := $(PERL) ./util/licence.pl
|
||||
NRV2B := ./util/nrv2b
|
||||
ZBIN := ./util/zbin
|
||||
ELF2EFI32 := ./util/elf2efi32
|
||||
ELF2EFI64 := ./util/elf2efi64
|
||||
EFIROM := ./util/efirom
|
||||
ICCFIX := ./util/iccfix
|
||||
DOXYGEN := doxygen
|
||||
BINUTILS_DIR := /usr
|
||||
BFD_DIR := $(BINUTILS_DIR)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
@@ -50,12 +55,14 @@ SRCDIRS :=
|
||||
SRCDIRS += libgcc
|
||||
SRCDIRS += core
|
||||
SRCDIRS += proto
|
||||
SRCDIRS += net net/tcp net/udp
|
||||
SRCDIRS += net net/tcp net/udp net/infiniband net/80211
|
||||
SRCDIRS += image
|
||||
SRCDIRS += drivers/bus
|
||||
SRCDIRS += drivers/net
|
||||
SRCDIRS += drivers/net/e1000
|
||||
SRCDIRS += drivers/net/phantom
|
||||
SRCDIRS += drivers/net/rtl818x
|
||||
SRCDIRS += drivers/net/ath5k
|
||||
SRCDIRS += drivers/block
|
||||
SRCDIRS += drivers/nvs
|
||||
SRCDIRS += drivers/bitbash
|
||||
@@ -73,6 +80,11 @@ SRCDIRS += usr
|
||||
NON_AUTO_SRCS :=
|
||||
NON_AUTO_SRCS += drivers/net/prism2.c
|
||||
|
||||
# INCDIRS lists the include path
|
||||
#
|
||||
INCDIRS :=
|
||||
INCDIRS += include .
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Default build target: build the most common targets and print out a
|
||||
@@ -117,7 +129,7 @@ install :
|
||||
#
|
||||
VERSION_MAJOR = 0
|
||||
VERSION_MINOR = 9
|
||||
VERSION_PATCH = 7
|
||||
VERSION_PATCH = 8
|
||||
EXTRAVERSION =
|
||||
MM_VERSION = $(VERSION_MAJOR).$(VERSION_MINOR)
|
||||
VERSION = $(MM_VERSION).$(VERSION_PATCH)$(EXTRAVERSION)
|
||||
|
||||
+180
-37
@@ -52,6 +52,14 @@ VERYCLEANUP += .echocheck
|
||||
echo :
|
||||
@$(ECHO) "Using \"$(ECHO_E)\" for \"echo -e\""
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Generate a usable "seq" substitute
|
||||
#
|
||||
define seq
|
||||
$(shell awk 'BEGIN { for ( i = $(1) ; i <= $(2) ; i++ ) print i }')
|
||||
endef
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Determine host OS
|
||||
@@ -60,6 +68,22 @@ HOST_OS := $(shell uname -s)
|
||||
hostos :
|
||||
@$(ECHO) $(HOST_OS)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Determine compiler
|
||||
|
||||
CCDEFS := $(shell $(CC) -E -x c -c /dev/null -dM | cut -d" " -f2)
|
||||
ccdefs:
|
||||
@$(ECHO) $(CCDEFS)
|
||||
|
||||
ifeq ($(filter __ICC,$(CCDEFS)),__ICC)
|
||||
CCTYPE := icc
|
||||
else
|
||||
CCTYPE := gcc
|
||||
endif
|
||||
cctype:
|
||||
@$(ECHO) $(CCTYPE)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Check for tools that can cause failed builds
|
||||
@@ -103,10 +127,30 @@ oldgas :
|
||||
# default, even when -ffreestanding is specified. We therefore need
|
||||
# to disable -fstack-protector if the compiler supports it.
|
||||
#
|
||||
ifeq ($(CCTYPE),gcc)
|
||||
SP_TEST = $(CC) -fno-stack-protector -x c -c /dev/null \
|
||||
-o /dev/null >/dev/null 2>&1
|
||||
SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
|
||||
CFLAGS += $(SP_FLAGS)
|
||||
endif
|
||||
|
||||
# gcc 4.4 generates .eh_frame sections by default, which distort the
|
||||
# output of "size". Inhibit this.
|
||||
#
|
||||
ifeq ($(CCTYPE),gcc)
|
||||
CFI_TEST = $(CC) -fno-dwarf2-cfi-asm -x c -c /dev/null \
|
||||
-o /dev/null >/dev/null 2>&1
|
||||
CFI_FLAGS := $(shell $(CFI_TEST) && $(ECHO) '-fno-dwarf2-cfi-asm')
|
||||
CFLAGS += $(CFI_FLAGS)
|
||||
endif
|
||||
|
||||
# Some versions of gas choke on division operators, treating them as
|
||||
# comment markers. Specifying --divide will work around this problem,
|
||||
# but isn't available on older gas versions.
|
||||
#
|
||||
DIVIDE_TEST = $(AS) --divide /dev/null -o /dev/null 2>/dev/null
|
||||
DIVIDE_FLAGS := $(shell $(DIVIDE_TEST) && $(ECHO) '--divide')
|
||||
ASFLAGS += $(DIVIDE_FLAGS)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
@@ -248,6 +292,11 @@ MAKEDEPS += arch/$(ARCH)/Makefile
|
||||
include arch/$(ARCH)/Makefile
|
||||
endif
|
||||
|
||||
# Include architecture-specific include path
|
||||
ifdef ARCH
|
||||
INCDIRS += arch/$(ARCH)/include
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Source file handling
|
||||
@@ -276,12 +325,45 @@ autosrcs :
|
||||
|
||||
ifdef BIN
|
||||
|
||||
# INCDIRS lists the include path
|
||||
incdirs :
|
||||
@$(ECHO) $(INCDIRS)
|
||||
|
||||
# Common flags
|
||||
#
|
||||
CFLAGS += -I include -I arch/$(ARCH)/include -I .
|
||||
CFLAGS += -Os -ffreestanding
|
||||
CFLAGS += -Wall -W -Wformat-nonliteral
|
||||
CFLAGS += $(foreach INC,$(INCDIRS),-I$(INC))
|
||||
CFLAGS += -Os
|
||||
CFLAGS += -g
|
||||
ifeq ($(CCTYPE),gcc)
|
||||
CFLAGS += -ffreestanding
|
||||
CFLAGS += -Wall -W -Wformat-nonliteral
|
||||
endif
|
||||
ifeq ($(CCTYPE),icc)
|
||||
CFLAGS += -fno-builtin
|
||||
CFLAGS += -no-ip
|
||||
CFLAGS += -no-gcc
|
||||
CFLAGS += -diag-disable 111 # Unreachable code
|
||||
CFLAGS += -diag-disable 128 # Unreachable loop
|
||||
CFLAGS += -diag-disable 170 # Array boundary checks
|
||||
CFLAGS += -diag-disable 177 # Unused functions
|
||||
CFLAGS += -diag-disable 181 # printf() format checks
|
||||
CFLAGS += -diag-disable 188 # enum strictness
|
||||
CFLAGS += -diag-disable 193 # Undefined preprocessor identifiers
|
||||
CFLAGS += -diag-disable 280 # switch ( constant )
|
||||
CFLAGS += -diag-disable 310 # K&R parameter lists
|
||||
CFLAGS += -diag-disable 424 # Extra semicolon
|
||||
CFLAGS += -diag-disable 589 # Declarations mid-code
|
||||
CFLAGS += -diag-disable 593 # Unused variables
|
||||
CFLAGS += -diag-disable 810 # Casting ints to smaller ints
|
||||
CFLAGS += -diag-disable 981 # Sequence point violations
|
||||
CFLAGS += -diag-disable 1292 # Ignored attributes
|
||||
CFLAGS += -diag-disable 1338 # void pointer arithmetic
|
||||
CFLAGS += -diag-disable 1361 # Variable-length arrays
|
||||
CFLAGS += -diag-disable 1418 # Missing prototypes
|
||||
CFLAGS += -diag-disable 1419 # Missing prototypes
|
||||
CFLAGS += -diag-disable 1599 # Hidden variables
|
||||
CFLAGS += -Wall -Wmissing-declarations
|
||||
endif
|
||||
CFLAGS += $(EXTRA_CFLAGS)
|
||||
ASFLAGS += $(EXTRA_ASFLAGS)
|
||||
LDFLAGS += $(EXTRA_LDFLAGS)
|
||||
@@ -314,11 +396,21 @@ OBJ_CFLAGS = $(CFLAGS_$(OBJECT)) -DOBJECT=$(subst -,_,$(OBJECT))
|
||||
$(BIN)/%.flags :
|
||||
@$(ECHO) $(OBJ_CFLAGS)
|
||||
|
||||
# ICC requires postprocessing objects to fix up table alignments
|
||||
#
|
||||
ifeq ($(CCTYPE),icc)
|
||||
POST_O = && $(ICCFIX) $@
|
||||
POST_O_DEPS := $(ICCFIX)
|
||||
else
|
||||
POST_O :=
|
||||
POST_O_DEPS :=
|
||||
endif
|
||||
|
||||
# Rules for specific object types.
|
||||
#
|
||||
COMPILE_c = $(CC) $(CFLAGS) $(CFLAGS_c) $(OBJ_CFLAGS)
|
||||
RULE_c = $(Q)$(COMPILE_c) -c $< -o $@
|
||||
RULE_c_to_dbg%.o = $(Q)$(COMPILE_c) -Ddebug_$(OBJECT)=$* -c $< -o $@
|
||||
RULE_c = $(Q)$(COMPILE_c) -c $< -o $@ $(POST_O)
|
||||
RULE_c_to_dbg%.o = $(Q)$(COMPILE_c) -Ddebug_$(OBJECT)=$* -c $< -o $@ $(POST_O)
|
||||
RULE_c_to_c = $(Q)$(COMPILE_c) -E -c $< > $@
|
||||
RULE_c_to_s = $(Q)$(COMPILE_c) -S -g0 -c $< -o $@
|
||||
|
||||
@@ -346,39 +438,25 @@ define src_template
|
||||
@$(MKDIR) -p $(dir $(2))
|
||||
@$(RM) $(2)
|
||||
@$(TOUCH) $(2)
|
||||
$(foreach OBJ,$(if $(OBJS_$(4)),$(OBJS_$(4)),$(4)), \
|
||||
$(call obj_template,$(1),$(2),$(3),$(OBJ)))
|
||||
@$(PARSEROM) $(1) >> $(2)
|
||||
|
||||
endef
|
||||
|
||||
# obj_template : generate Makefile rules for a given resultant object
|
||||
# of a particular source file. (We can have multiple objects per
|
||||
# source file via the OBJS_xxx list.)
|
||||
#
|
||||
# $(1) is the full path to the source file (e.g. "drivers/net/rtl8139.c")
|
||||
# $(2) is the full path to the .d file (e.g. "bin/deps/drivers/net/rtl8139.d")
|
||||
# $(3) is the source type (e.g. "c")
|
||||
# $(4) is the object name (e.g. "rtl8139")
|
||||
#
|
||||
define obj_template
|
||||
|
||||
@$(CPP) $(CFLAGS) $(CFLAGS_$(3)) $(CFLAGS_$(4)) -DOBJECT=$(4) \
|
||||
-Wno-error -MM $(1) -MT "$(4)_DEPS" -MG -MP | \
|
||||
sed 's/_DEPS\s*:/_DEPS =/' >> $(2)
|
||||
@$(ECHO_E) '\n$$(BIN)/$(4).o : $(1) $$(MAKEDEPS) $$($(4)_DEPS)' \
|
||||
-Wno-error -MM $(1) -MG -MP | \
|
||||
sed 's/\.o\s*:/_DEPS =/' >> $(2)
|
||||
@$(ECHO_E) '\n$$(BIN)/$(4).o :' \
|
||||
'$(1) $$(MAKEDEPS) $$(POST_O_DEPS) $$($(4)_DEPS)' \
|
||||
'\n\t$$(QM)$(ECHO) " [BUILD] $$@"' \
|
||||
'\n\t$$(RULE_$(3))\n' \
|
||||
'\nBOBJS += $$(BIN)/$(4).o\n' \
|
||||
$(foreach TGT,$(DEBUG_TARGETS), \
|
||||
$(if $(RULE_$(3)_to_$(TGT)), \
|
||||
'\n$$(BIN)/$(4).$(TGT) : $(1) $$(MAKEDEPS) $$($(4)_DEPS)' \
|
||||
'\n$$(BIN)/$(4).$(TGT) :' \
|
||||
'$(1) $$(MAKEDEPS) $$(POST_O_DEPS) $$($(4)_DEPS)' \
|
||||
'\n\t$$(QM)$(ECHO) " [BUILD] $$@"' \
|
||||
'\n\t$$(RULE_$(3)_to_$(TGT))\n' \
|
||||
'\n$(TGT)_OBJS += $$(BIN)/$(4).$(TGT)\n' ) ) \
|
||||
'\n$(2) : $$($(4)_DEPS)\n' \
|
||||
'\nTAGS : $$($(4)_DEPS)\n' \
|
||||
>> $(2)
|
||||
@$(PARSEROM) $(1) >> $(2)
|
||||
|
||||
endef
|
||||
|
||||
@@ -415,7 +493,7 @@ roms :
|
||||
#
|
||||
EMBEDDED_LIST := $(BIN)/.embedded.list
|
||||
ifeq ($(wildcard $(EMBEDDED_LIST)),)
|
||||
EMBEDDED_LIST_IMAGE :=
|
||||
EMBEDDED_LIST_IMAGE := <invalid>
|
||||
else
|
||||
EMBEDDED_LIST_IMAGE := $(shell cat $(EMBEDDED_LIST))
|
||||
endif
|
||||
@@ -428,7 +506,7 @@ $(EMBEDDED_LIST) :
|
||||
VERYCLEANUP += $(EMBEDDED_LIST)
|
||||
|
||||
EMBEDDED_FILES := $(subst $(COMMA), ,$(EMBEDDED_IMAGE))
|
||||
EMBED_ALL := $(foreach i,$(shell seq 1 $(words $(EMBEDDED_FILES))),\
|
||||
EMBED_ALL := $(foreach i,$(call seq,1,$(words $(EMBEDDED_FILES))),\
|
||||
EMBED ( $(i), \"$(word $(i), $(EMBEDDED_FILES))\",\
|
||||
\"$(notdir $(word $(i),$(EMBEDDED_FILES)))\" ))
|
||||
|
||||
@@ -550,7 +628,7 @@ $(BIN)/%.info :
|
||||
#
|
||||
BLIB_LIST := $(BIN)/.blib.list
|
||||
ifeq ($(wildcard $(BLIB_LIST)),)
|
||||
BLIB_LIST_OBJS :=
|
||||
BLIB_LIST_OBJS := <invalid>
|
||||
else
|
||||
BLIB_LIST_OBJS := $(shell cat $(BLIB_LIST))
|
||||
endif
|
||||
@@ -589,6 +667,55 @@ $(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT)
|
||||
$(BIN)/%.map : $(BIN)/%.tmp
|
||||
@less $(BIN)/$*.tmp.map
|
||||
|
||||
# Get objects list for the specified target
|
||||
#
|
||||
define objs_list
|
||||
$(sort $(foreach OBJ_SYMBOL,\
|
||||
$(filter obj_%,$(shell $(NM) $(1) | cut -d" " -f3)),\
|
||||
$(patsubst obj_%,%,$(OBJ_SYMBOL))))
|
||||
endef
|
||||
$(BIN)/%.objs : $(BIN)/%.tmp
|
||||
$(Q)$(ECHO) $(call objs_list,$<)
|
||||
$(BIN)/%.sizes : $(BIN)/%.tmp
|
||||
$(Q)$(SIZE) -t $(foreach OBJ,$(call objs_list,$<),$(BIN)/$(OBJ).o) | \
|
||||
sort -g
|
||||
|
||||
# Get dependency list for the specified target
|
||||
#
|
||||
define deps_list
|
||||
$(sort $(foreach OBJ,$(call objs_list,$(1)),$($(OBJ)_DEPS)))
|
||||
endef
|
||||
$(BIN)/%.deps : $(BIN)/%.tmp
|
||||
$(Q)$(ECHO) $(call deps_list,$<)
|
||||
|
||||
# Get unneeded source files for the specified target
|
||||
#
|
||||
define nodeps_list
|
||||
$(sort $(filter-out $(call deps_list,$(1)),\
|
||||
$(foreach BOBJ,$(BOBJS),\
|
||||
$($(basename $(notdir $(BOBJ)))_DEPS))))
|
||||
endef
|
||||
$(BIN)/%.nodeps : $(BIN)/%.tmp
|
||||
$(Q)$(ECHO) $(call nodeps_list,$<)
|
||||
|
||||
# Get licensing verdict for the specified target
|
||||
#
|
||||
define unlicensed_deps_list
|
||||
$(shell grep -L FILE_LICENCE $(call deps_list,$(1)))
|
||||
endef
|
||||
define licence_list
|
||||
$(patsubst __licence_%,%,\
|
||||
$(filter __licence_%,$(shell $(NM) $(1) | cut -d" " -f3)))
|
||||
endef
|
||||
$(BIN)/%.licence : $(BIN)/%.tmp
|
||||
$(QM)$(ECHO) " [LICENCE] $@"
|
||||
$(Q)$(if $(strip $(call unlicensed_deps_list,$<)),\
|
||||
echo -n "Unable to determine licence because the following " ;\
|
||||
echo "files are missing a licence declaration:" ;\
|
||||
echo $(call unlicensed_deps_list,$<);\
|
||||
exit 1,\
|
||||
$(LICENCE) $(call licence_list,$<))
|
||||
|
||||
# Extract compression information from intermediate object file
|
||||
#
|
||||
$(BIN)/%.zinfo : $(BIN)/%.tmp
|
||||
@@ -649,6 +776,7 @@ define media_template
|
||||
@$(ECHO_E) '$$(BIN)/%.$(1) : $$(BIN)/%.$(1).zbin' \
|
||||
'\n\t$$(QM)$(ECHO) " [FINISH] $$@"' \
|
||||
'\n\t$$(Q)$$(CP) $$< $$@' \
|
||||
'\n\t$$(Q)$$(PAD_$(1))' \
|
||||
'\n\t$$(Q)$$(FINALISE_$(1))' \
|
||||
> $(2)
|
||||
|
||||
@@ -726,16 +854,18 @@ CLEANUP += $(ZBIN)
|
||||
#
|
||||
# The EFI image converter
|
||||
#
|
||||
ELF2EFI_CFLAGS := -I$(BINUTILS_DIR)/include -I$(BFD_DIR)/include \
|
||||
-idirafter include -L$(BINUTILS_DIR)/lib -L$(BFD_DIR)/lib \
|
||||
-lbfd -liberty -lz
|
||||
|
||||
$(ELF2EFI32) : util/elf2efi.c $(MAKEDEPS)
|
||||
$(QM)$(ECHO) " [HOSTCC] $@"
|
||||
$(Q)$(HOST_CC) -DMDE_CPU_IA32 -idirafter include -O2 \
|
||||
-o $@ $< -lbfd -liberty
|
||||
$(Q)$(HOST_CC) $(ELF2EFI_CFLAGS) -DMDE_CPU_IA32 -O2 -o $@ $<
|
||||
CLEANUP += $(ELF2EFI32)
|
||||
|
||||
$(ELF2EFI64) : util/elf2efi.c $(MAKEDEPS)
|
||||
$(QM)$(ECHO) " [HOSTCC] $@"
|
||||
$(Q)$(HOST_CC) -DMDE_CPU_X64 -idirafter include -O2 \
|
||||
-o $@ $< -lbfd -liberty
|
||||
$(Q)$(HOST_CC) $(ELF2EFI_CFLAGS) -DMDE_CPU_X64 -O2 -o $@ $<
|
||||
CLEANUP += $(ELF2EFI64)
|
||||
|
||||
$(EFIROM) : util/efirom.c $(MAKEDEPS)
|
||||
@@ -743,6 +873,15 @@ $(EFIROM) : util/efirom.c $(MAKEDEPS)
|
||||
$(Q)$(HOST_CC) -idirafter include -O2 -o $@ $<
|
||||
CLEANUP += $(EFIROM)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# The ICC fixup utility
|
||||
#
|
||||
$(ICCFIX) : util/iccfix.c $(MAKEDEPS)
|
||||
$(QM)$(ECHO) " [HOSTCC] $@"
|
||||
$(Q)$(HOST_CC) -idirafter include -O2 -o $@ $<
|
||||
CLEANUP += $(ICCFIX)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Auto-incrementing build serial number. Append "bs" to your list of
|
||||
@@ -823,20 +962,24 @@ endif # defined(BIN)
|
||||
ifdef BIN
|
||||
|
||||
$(BIN)/doxygen.cfg : doxygen.cfg $(MAKEDEPS)
|
||||
$(PERL) -pe 's{\@SRCDIRS\@}{$(SRCDIRS)}; ' \
|
||||
$(Q)$(PERL) -pe 's{\@SRCDIRS\@}{$(SRCDIRS)}; ' \
|
||||
-e 's{\@INCDIRS\@}{$(filter-out .,$(INCDIRS))}; ' \
|
||||
-e 's{\@BIN\@}{$(BIN)}; ' \
|
||||
-e 's{\@ARCH\@}{$(ARCH)}; ' \
|
||||
$< > $@
|
||||
|
||||
$(BIN)/doc : $(BIN)/doxygen.cfg
|
||||
$(DOXYGEN) $<
|
||||
$(Q)$(DOXYGEN) $<
|
||||
|
||||
.PHONY : $(BIN)/doc
|
||||
|
||||
VERYCLEANUP += $(BIN)/doc
|
||||
|
||||
doc : $(BIN)/doc
|
||||
|
||||
doc-clean :
|
||||
$(Q)$(RM) -r $(BIN)/doc
|
||||
|
||||
VERYCLEANUP += $(BIN)/doc
|
||||
|
||||
docview :
|
||||
@[ -f $(BIN)/doc/html/index.html ] || $(MAKE) $(BIN)/doc
|
||||
@if [ -n "$$BROWSER" ] ; then \
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
This file documents the driver changes needed to support use as part
|
||||
of a PXE stack.
|
||||
|
||||
PROPER WAY
|
||||
==========
|
||||
|
||||
1. The probe() routine.
|
||||
|
||||
There are three additional fields that need to be filled in the nic
|
||||
structure: ioaddr, irqno and irq.
|
||||
|
||||
ioaddr is the base I/O address and seems to be for information only;
|
||||
no use will be made of this value other than displaying it on the
|
||||
screen.
|
||||
|
||||
irqno must be the IRQ number for the NIC. For PCI NICs this can
|
||||
simply be copied from pci->irq.
|
||||
|
||||
irq is a function pointer, like poll and transmit. It must point to
|
||||
the driver's irq() function.
|
||||
|
||||
2. The poll() routine.
|
||||
|
||||
This must take an additional parameter: "int retrieve". Calling
|
||||
poll() with retrieve!=0 should function exactly as before. Calling
|
||||
poll() with retrieve==0 indicates that poll() should check for the
|
||||
presence of a packet to read, but must *not* read the packet. The
|
||||
packet will be read by a subsequent call to poll() with retrieve!=0.
|
||||
|
||||
The easiest way to implement this is to insert the line
|
||||
if ( ! retrieve ) return 1;
|
||||
between the "is there a packet ready" and the "fetch packet" parts of
|
||||
the existing poll() routine.
|
||||
|
||||
Care must be taken that a call to poll() with retrieve==0 does not
|
||||
clear the NIC's "packet ready" status indicator, otherwise the
|
||||
subsequent call to poll() with retrieve!=0 will fail because it will
|
||||
think that there is no packet to read.
|
||||
|
||||
poll() should also acknowledge and clear the NIC's "packet received"
|
||||
interrupt. It does not need to worry about enabling/disabling
|
||||
interrupts; this is taken care of by calls to the driver's irq()
|
||||
routine.
|
||||
|
||||
Etherboot will forcibly regenerate an interrupt if a packet remains
|
||||
pending after all interrupts have been acknowledged. You can
|
||||
therefore get away with having poll() just acknolwedge and clear all
|
||||
NIC interrupts, without particularly worrying about exactly when this
|
||||
should be done.
|
||||
|
||||
3. The irq() routine.
|
||||
|
||||
This is a new routine, with prototype
|
||||
void DRIVER_irq ( struct nic *nic, irq_action_t action );
|
||||
"action" takes one of three possible values: ENABLE, DISABLE or FORCE.
|
||||
ENABLE and DISABLE mean to enable/disable the NIC's "packet received"
|
||||
interrupt. FORCE means that the NIC should be forced to generate a
|
||||
fake "packet received" interrupt.
|
||||
|
||||
If you are unable to implement FORCE, your NIC will not work when
|
||||
being driven via the UNDI interface under heavy network traffic
|
||||
conditions. Since Etherboot's UNDI driver (make bin/undi.zpxe) is the
|
||||
only program known to use this interface, it probably doesn't really
|
||||
matter.
|
||||
|
||||
|
||||
QUICK AND DIRTY WAY
|
||||
===================
|
||||
|
||||
It is possible to use the system timer interrupt (IRQ 0) rather than a
|
||||
genuine NIC interrupt. Since there is a constant stream of timer
|
||||
interrupts, the net upshot is a whole load of spurious "NIC"
|
||||
interrupts that have no effect other than to cause unnecessary PXE API
|
||||
calls. It's inefficient but it works.
|
||||
|
||||
To achieve this, simply set nic->irqno=0 in probe() and point nic->irq
|
||||
to a dummy routine that does nothing. Add the line
|
||||
if ( ! retrieve ) return 1;
|
||||
at the beginning of poll(), to prevent the packet being read (and
|
||||
discarded) when poll() is called with retrieve==0;
|
||||
|
||||
|
||||
UNCONVERTED DRIVERS
|
||||
===================
|
||||
|
||||
Drivers that have not yet been converted should continue to function
|
||||
when not used as part of a PXE stack, although there will be a
|
||||
harmless compile-time warning about assignment from an incompatible
|
||||
pointer type in the probe() function, since the prototype for the
|
||||
poll() function is missing the "int retrieve" parameter.
|
||||
+17
-15
@@ -4,22 +4,33 @@ CFLAGS += -march=i386
|
||||
|
||||
# Code size reduction.
|
||||
#
|
||||
CFLAGS += -fstrength-reduce -fomit-frame-pointer
|
||||
CFLAGS += -fomit-frame-pointer
|
||||
|
||||
# Code size reduction.
|
||||
#
|
||||
ifeq ($(CCTYPE),gcc)
|
||||
CFLAGS += -fstrength-reduce
|
||||
endif
|
||||
|
||||
# Code size reduction. gcc3 needs a different syntax to gcc2 if you
|
||||
# want to avoid spurious warnings.
|
||||
#
|
||||
ifeq ($(CCTYPE),gcc)
|
||||
GCC_VERSION := $(subst ., ,$(shell $(CC) -dumpversion))
|
||||
GCC_MAJOR := $(firstword $(GCC_VERSION))
|
||||
ifeq ($(GCC_MAJOR),2)
|
||||
CFLAGS += -malign-jumps=1 -malign-loops=1 -malign-functions=1
|
||||
else
|
||||
CFLAGS += -falign-jumps=1 -falign-loops=1 -falign-functions=1
|
||||
endif
|
||||
endif # gcc2
|
||||
endif # gcc
|
||||
|
||||
# Code size reduction. This is almost always a win. The kernel uses it, too.
|
||||
# Code size reduction. This is almost always a win. The kernel uses
|
||||
# it, too.
|
||||
#
|
||||
ifeq ($(CCTYPE),gcc)
|
||||
CFLAGS += -mpreferred-stack-boundary=2
|
||||
endif
|
||||
|
||||
# Code size reduction. Use regparm for all functions - C functions
|
||||
# called from assembly (or vice versa) need __asmcall now
|
||||
@@ -27,7 +38,9 @@ CFLAGS += -mpreferred-stack-boundary=2
|
||||
CFLAGS += -mregparm=3
|
||||
|
||||
# Code size reduction. Use -mrtd (same __asmcall requirements as above)
|
||||
ifeq ($(CCTYPE),gcc)
|
||||
CFLAGS += -mrtd
|
||||
endif
|
||||
|
||||
# Code size reduction. This is the logical complement to -mregparm=3.
|
||||
# It doesn't currently buy us anything, but if anything ever tries to
|
||||
@@ -68,6 +81,7 @@ SRCDIRS += arch/i386/drivers/net
|
||||
SRCDIRS += arch/i386/interface/pcbios
|
||||
SRCDIRS += arch/i386/interface/pxe
|
||||
SRCDIRS += arch/i386/interface/syslinux
|
||||
SRCDIRS += arch/i386/hci/commands
|
||||
|
||||
# The various xxx_loader.c files are #included into core/loader.c and
|
||||
# should not be compiled directly.
|
||||
@@ -76,11 +90,6 @@ NON_AUTO_SRCS += arch/i386/core/aout_loader.c
|
||||
NON_AUTO_SRCS += arch/i386/core/freebsd_loader.c
|
||||
NON_AUTO_SRCS += arch/i386/core/wince_loader.c
|
||||
|
||||
# unnrv2b.S is used to generate a 16-bit as well as a 32-bit object.
|
||||
#
|
||||
OBJS_unnrv2b = unnrv2b unnrv2b16
|
||||
CFLAGS_unnrv2b16 = -DCODE16
|
||||
|
||||
# Include common x86 Makefile
|
||||
#
|
||||
MAKEDEPS += arch/x86/Makefile
|
||||
@@ -101,13 +110,6 @@ NON_AUTO_MEDIA += fd0
|
||||
$(Q)dd if=$< bs=512 conv=sync of=/dev/fd0
|
||||
$(Q)sync
|
||||
|
||||
# rule to create padded disk images
|
||||
NON_AUTO_MEDIA += pdsk
|
||||
%pdsk : %dsk
|
||||
$(QM)$(ECHO) " [DSKPAD] $@"
|
||||
$(Q)cp $< $@
|
||||
$(Q)$(PERL) ./util/dskpad.pl $@
|
||||
|
||||
# Add NON_AUTO_MEDIA to the media list, so that they show up in the
|
||||
# output of "make"
|
||||
#
|
||||
|
||||
@@ -27,6 +27,12 @@ MEDIA += raw
|
||||
MEDIA += com
|
||||
MEDIA += exe
|
||||
|
||||
# Padding rules
|
||||
#
|
||||
PAD_rom = $(PADIMG) --blksize=512 --byte=0xff $@
|
||||
PAD_dsk = $(PADIMG) --blksize=512 $@
|
||||
PAD_hd = $(PADIMG) --blksize=512 $@
|
||||
|
||||
# rule to make a non-emulation ISO boot image
|
||||
NON_AUTO_MEDIA += iso
|
||||
%iso: %lkrn util/geniso
|
||||
@@ -39,6 +45,12 @@ NON_AUTO_MEDIA += liso
|
||||
$(QM)$(ECHO) " [GENLISO] $@"
|
||||
$(Q)bash util/genliso $@ $<
|
||||
|
||||
# rule to make a syslinux floppy image (mountable, bootable)
|
||||
NON_AUTO_MEDIA += sdsk
|
||||
%sdsk: %lkrn util/gensdsk
|
||||
$(QM)$(ECHO) " [GENSDSK] $@"
|
||||
$(Q)bash util/gensdsk $@ $<
|
||||
|
||||
# Special target for building Master Boot Record binary
|
||||
$(BIN)/mbr.bin : $(BIN)/mbr.o
|
||||
$(QM)$(ECHO) " [OBJCOPY] $@"
|
||||
@@ -53,3 +65,9 @@ NON_AUTO_MEDIA += usb
|
||||
%usb: $(BIN)/usbdisk.bin %hd
|
||||
$(QM)$(ECHO) " [FINISH] $@"
|
||||
$(Q)cat $^ > $@
|
||||
|
||||
# Padded floppy image (e.g. for iLO)
|
||||
NON_AUTO_MEDIA += pdsk
|
||||
%pdsk : %dsk
|
||||
$(Q)cp $< $@
|
||||
$(Q)$(PADIMG) --blksize=1474560 $@
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
|
||||
OUTPUT_ARCH(i386)
|
||||
|
||||
ENTRY(_prefix_start)
|
||||
SECTIONS {
|
||||
/* Prefix */
|
||||
.prefix : {
|
||||
_verbatim_start = . ;
|
||||
_prefix_start = . ;
|
||||
*(.prefix)
|
||||
. = ALIGN(16);
|
||||
_prefix_end = . ;
|
||||
} = 0x9090
|
||||
_prefix_size = _prefix_end - _prefix_start;
|
||||
|
||||
.text.nocompress : {
|
||||
*(.prefix.udata)
|
||||
} = 0x9090
|
||||
|
||||
decompress_to = . ;
|
||||
.prefix.zdata : {
|
||||
_compressed = . ;
|
||||
*(.prefix.zdata)
|
||||
_compressed_end = . ;
|
||||
}
|
||||
_compressed_size = _compressed_end - _compressed;
|
||||
|
||||
. = ALIGN(16);
|
||||
_verbatim_end = . ;
|
||||
|
||||
|
||||
/* Size of the core of etherboot in memory */
|
||||
_base_size = _end - _text;
|
||||
|
||||
/* _prefix_size is the length of the non-core etherboot prefix */
|
||||
_prefix_size = _prefix_end - _prefix_start;
|
||||
|
||||
/* _verbatim_size is the actual amount that has to be copied to base memory */
|
||||
_verbatim_size = _verbatim_end - _verbatim_start;
|
||||
|
||||
/* _image_size is the amount of base memory needed to run */
|
||||
_image_size = _base_size + _prefix_size;
|
||||
|
||||
/* Standard sizes rounded up to paragraphs */
|
||||
_prefix_size_pgh = (_prefix_size + 15) / 16;
|
||||
_verbatim_size_pgh = (_verbatim_size + 15) / 16;
|
||||
_image_size_pgh = (_image_size + 15) / 16 ;
|
||||
|
||||
/* Standard sizes in sectors */
|
||||
_prefix_size_sct = (_prefix_size + 511) / 512;
|
||||
_verbatim_size_sct = (_verbatim_size + 511) / 512;
|
||||
_image_size_sct = (_image_size + 511) / 512;
|
||||
|
||||
/* Symbol offsets and sizes for the exe prefix */
|
||||
_exe_hdr_size = 32;
|
||||
_exe_size = _verbatim_size; /* Should this be - 32 to exclude the header? */
|
||||
_exe_size_tail = (_exe_size) % 512;
|
||||
_exe_size_pages = ((_exe_size) + 511) / 512;
|
||||
_exe_bss_size = ((_image_size - _verbatim_size) + 15) / 16;
|
||||
_exe_ss_offset = (_stack_offset + _prefix_size - _exe_hdr_size + 15) / 16 ;
|
||||
|
||||
/* This is where we copy the compressed image before decompression.
|
||||
* Prepare to decompress in place. The end mark is about 8.25 bytes long,
|
||||
* and the worst case symbol is about 16.5 bytes long. Therefore
|
||||
* We need to reserve at least 25 bytes of slack here.
|
||||
* Currently I reserve 2048 bytes of just slack to be safe :)
|
||||
* 2048 bytes easily falls within the BSS (the defualt stack is 4096 bytes)
|
||||
* so we really are decompressing in place.
|
||||
*
|
||||
* Hmm. I missed a trick. In the very worst case (no compression)
|
||||
* the encoded data is 9/8 the size as it started out so to be completely
|
||||
* safe I need to be 1/8 of the uncompressed code size past the end.
|
||||
* This will still fit compfortably into our bss in any conceivable scenario.
|
||||
*/
|
||||
_compressed_copy = _edata + _prefix_size - _compressed_size +
|
||||
/* The amount to overflow _edata */
|
||||
MAX( ((_edata - _text + 7) / 8) , 2016 ) + 32;
|
||||
_assert = ASSERT( ( _compressed_copy - _prefix_size ) < _ebss , "Cannot decompress in place" ) ;
|
||||
|
||||
decompress = DEFINED(decompress) ? decompress : 0;
|
||||
/DISCARD/ : {
|
||||
*(.comment)
|
||||
*(.note)
|
||||
}
|
||||
|
||||
/* Symbols used by the prefixes whose addresses are inconvinient
|
||||
* to compute, at runtime in the code.
|
||||
*/
|
||||
image_basemem_size = DEFINED(image_basemem_size)? image_basemem_size : 65536;
|
||||
image_basemem = DEFINED(image_basemem)? image_basemem : 65536;
|
||||
_prefix_real_to_prot = _real_to_prot + _prefix_size ;
|
||||
_prefix_prot_to_real = _prot_to_real + _prefix_size ;
|
||||
_prefix_image_basemem_size = image_basemem_size + _prefix_size ;
|
||||
_prefix_image_basemem = image_basemem + _prefix_size ;
|
||||
_prefix_rm_in_call = _rm_in_call + _prefix_size ;
|
||||
_prefix_in_call = _in_call + _prefix_size ;
|
||||
_prefix_rom = rom + _prefix_size ;
|
||||
_prefix_rm_etherboot_location = rm_etherboot_location + _prefix_size ;
|
||||
_prefix_stack_end = _stack_end + _prefix_size ;
|
||||
}
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <gpxe/io.h>
|
||||
#include <pic8259.h>
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
|
||||
OUTPUT_ARCH(i386)
|
||||
|
||||
SECTIONS {
|
||||
.prefix.udata : {
|
||||
*(*)
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
|
||||
OUTPUT_ARCH(i386)
|
||||
|
||||
SECTIONS {
|
||||
.prefix.zdata : {
|
||||
*(*)
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/** @file
|
||||
*
|
||||
* RDTSC timer
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/* Real-mode interface: C portions.
|
||||
*
|
||||
* Initial version by Michael Brown <mbrown@fensystems.co.uk>, January 2004.
|
||||
*/
|
||||
|
||||
#include "realmode.h"
|
||||
|
||||
/*
|
||||
* Copy data to/from base memory.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef KEEP_IT_REAL
|
||||
|
||||
void memcpy_to_real ( segoff_t dest, void *src, size_t n ) {
|
||||
|
||||
}
|
||||
|
||||
void memcpy_from_real ( void *dest, segoff_t src, size_t n ) {
|
||||
|
||||
}
|
||||
|
||||
#endif /* KEEP_IT_REAL */
|
||||
@@ -9,6 +9,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/*
|
||||
* The linker passes in the symbol _max_align, which is the alignment
|
||||
* that we must preserve, in bytes.
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/* setjmp and longjmp. Use of these functions is deprecated. */
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER )
|
||||
|
||||
.text
|
||||
.arch i386
|
||||
.code32
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
FILE_LICENCE ( GPL2_OR_LATER )
|
||||
|
||||
.arch i386
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
FILE_LICENCE ( GPL2_OR_LATER )
|
||||
|
||||
.arch i386
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
/* When linking with an uncompressed image, these symbols are not
|
||||
* defined so we provide them here.
|
||||
*/
|
||||
|
||||
__decompressor_uncompressed = 0 ;
|
||||
__decompressor__start = 0 ;
|
||||
|
||||
INCLUDE arch/i386/core/start16z.lds
|
||||
@@ -1,65 +0,0 @@
|
||||
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
|
||||
OUTPUT_ARCH(i386)
|
||||
|
||||
/* Linker-generated symbols are prefixed with a double underscore.
|
||||
* Decompressor symbols are prefixed with __decompressor_. All other
|
||||
* symbols are the same as in the original object file, i.e. the
|
||||
* runtime addresses.
|
||||
*/
|
||||
|
||||
ENTRY(_start16)
|
||||
|
||||
SECTIONS {
|
||||
.text : {
|
||||
*(.text)
|
||||
}
|
||||
.payload : {
|
||||
__payload_start = .;
|
||||
*(.data)
|
||||
__payload_end = .;
|
||||
}
|
||||
|
||||
/* _payload_size is the size of the binary image appended to
|
||||
* start16, in bytes.
|
||||
*/
|
||||
__payload_size = __payload_end - __payload_start ;
|
||||
|
||||
/* _size is the size of the runtime image
|
||||
* (start32 + the C code), in bytes.
|
||||
*/
|
||||
__size = _end - _start ;
|
||||
|
||||
/* _decompressor_size is the size of the decompressor, in
|
||||
* bytes. For a non-compressed image, start16.lds sets
|
||||
* _decompressor_uncompressed = _decompressor__start = 0.
|
||||
*/
|
||||
__decompressor_size = __decompressor_uncompressed - __decompressor__start ;
|
||||
|
||||
/* image__size is the total size of the image, after
|
||||
* decompression and including the decompressor if applicable.
|
||||
* It is therefore the amount of memory that start16's payload
|
||||
* needs in order to execute, in bytes.
|
||||
*/
|
||||
__image_size = __size + __decompressor_size ;
|
||||
|
||||
/* Amount to add to runtime symbols to obtain the offset of
|
||||
* that symbol within the image.
|
||||
*/
|
||||
__offset_adjust = __decompressor_size - _start ;
|
||||
|
||||
/* Calculations for the stack
|
||||
*/
|
||||
__stack_size = _estack - _stack ;
|
||||
__offset_stack = _stack + __offset_adjust ;
|
||||
|
||||
/* Some symbols will be larger than 16 bits but guaranteed to
|
||||
* be multiples of 16. We calculate them in paragraphs and
|
||||
* export these symbols which can be used in 16-bit code
|
||||
* without risk of overflow.
|
||||
*/
|
||||
__image_size_pgh = ( __image_size / 16 );
|
||||
__start_pgh = ( _start / 16 );
|
||||
__decompressor_size_pgh = ( __decompressor_size / 16 );
|
||||
__offset_stack_pgh = ( __offset_stack / 16 );
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
* your option) any later version.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stddef.h>
|
||||
#include <gpxe/timer2.h>
|
||||
#include <gpxe/io.h>
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER )
|
||||
|
||||
#include "librm.h"
|
||||
|
||||
.arch i386
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <gpxe/io.h>
|
||||
#include <gpxe/x86_io.h>
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@@ -135,7 +137,7 @@ static void undipci_remove ( struct pci_device *pci ) {
|
||||
}
|
||||
|
||||
static struct pci_device_id undipci_nics[] = {
|
||||
PCI_ROM ( 0xffff, 0xffff, "undipci", "UNDI (PCI)" ),
|
||||
PCI_ROM ( 0xffff, 0xffff, "undipci", "UNDI (PCI)", 0 ),
|
||||
};
|
||||
|
||||
struct pci_driver undipci_driver __pci_driver = {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
FILE_LICENCE ( GPL2_OR_LATER )
|
||||
|
||||
#define PXENV_UNDI_ISR 0x0014
|
||||
#define PXENV_UNDI_ISR_IN_START 1
|
||||
#define PXENV_UNDI_ISR_OUT_OURS 0
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -90,11 +92,10 @@ int undi_load ( struct undi_device *undi, struct undi_rom *undirom ) {
|
||||
undi_loader_entry = undirom->loader_entry;
|
||||
__asm__ __volatile__ ( REAL_CODE ( "pushw %%ds\n\t"
|
||||
"pushw %%ax\n\t"
|
||||
"lcall *%c2\n\t"
|
||||
"lcall *undi_loader_entry\n\t"
|
||||
"addw $4, %%sp\n\t" )
|
||||
: "=a" ( exit )
|
||||
: "a" ( __from_data16 ( &undi_loader ) ),
|
||||
"p" ( __from_data16 ( &undi_loader_entry ) )
|
||||
: "a" ( __from_data16 ( &undi_loader ) )
|
||||
: "ebx", "ecx", "edx", "esi", "edi", "ebp" );
|
||||
|
||||
/* UNDI API calls may rudely change the status of A20 and not
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <string.h>
|
||||
#include <pxe.h>
|
||||
#include <realmode.h>
|
||||
@@ -173,12 +175,11 @@ static int undinet_call ( struct undi_nic *undinic, unsigned int function,
|
||||
__asm__ __volatile__ ( REAL_CODE ( "pushw %%es\n\t"
|
||||
"pushw %%di\n\t"
|
||||
"pushw %%bx\n\t"
|
||||
"lcall *%c3\n\t"
|
||||
"lcall *undinet_entry_point\n\t"
|
||||
"addw $6, %%sp\n\t" )
|
||||
: "=a" ( exit ), "=b" ( discard_b ),
|
||||
"=D" ( discard_D )
|
||||
: "p" ( __from_data16 ( &undinet_entry_point )),
|
||||
"b" ( function ),
|
||||
: "b" ( function ),
|
||||
"D" ( __from_data16 ( &undinet_params ) )
|
||||
: "ecx", "edx", "esi", "ebp" );
|
||||
|
||||
@@ -688,7 +689,7 @@ int undinet_probe ( struct undi_device *undi ) {
|
||||
if ( ( rc = undinet_call ( undinic, PXENV_UNDI_GET_INFORMATION,
|
||||
&undi_info, sizeof ( undi_info ) ) ) != 0 )
|
||||
goto err_undi_get_information;
|
||||
memcpy ( netdev->ll_addr, undi_info.PermNodeAddress, ETH_ALEN );
|
||||
memcpy ( netdev->hw_addr, undi_info.PermNodeAddress, ETH_ALEN );
|
||||
undinic->irq = undi_info.IntNumber;
|
||||
if ( undinic->irq > IRQ_MAX ) {
|
||||
DBGC ( undinic, "UNDINIC %p invalid IRQ %d\n",
|
||||
@@ -696,7 +697,7 @@ int undinet_probe ( struct undi_device *undi ) {
|
||||
goto err_bad_irq;
|
||||
}
|
||||
DBGC ( undinic, "UNDINIC %p is %s on IRQ %d\n",
|
||||
undinic, eth_ntoa ( netdev->ll_addr ), undinic->irq );
|
||||
undinic, eth_ntoa ( netdev->hw_addr ), undinic->irq );
|
||||
|
||||
/* Get interface information */
|
||||
memset ( &undi_iface, 0, sizeof ( undi_iface ) );
|
||||
@@ -704,8 +705,9 @@ int undinet_probe ( struct undi_device *undi ) {
|
||||
&undi_iface,
|
||||
sizeof ( undi_iface ) ) ) != 0 )
|
||||
goto err_undi_get_iface_info;
|
||||
DBGC ( undinic, "UNDINIC %p has type %s and link speed %d\n",
|
||||
undinic, undi_iface.IfaceType, undi_iface.LinkSpeed );
|
||||
DBGC ( undinic, "UNDINIC %p has type %s, speed %d, flags %08x\n",
|
||||
undinic, undi_iface.IfaceType, undi_iface.LinkSpeed,
|
||||
undi_iface.ServiceFlags );
|
||||
if ( strncmp ( ( ( char * ) undi_iface.IfaceType ), "Etherboot",
|
||||
sizeof ( undi_iface.IfaceType ) ) == 0 ) {
|
||||
DBGC ( undinic, "UNDINIC %p Etherboot 5.4 workaround enabled\n",
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <realmode.h>
|
||||
#include <undipreload.h>
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <realmode.h>
|
||||
#include <bios.h>
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <assert.h>
|
||||
#include <realmode.h>
|
||||
#include <console.h>
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER )
|
||||
|
||||
.text
|
||||
.arch i386
|
||||
.code16
|
||||
@@ -489,6 +491,18 @@ get_mangled_e820:
|
||||
ret
|
||||
.size get_mangled_e820, . - get_mangled_e820
|
||||
|
||||
/****************************************************************************
|
||||
* Set/clear CF on the stack as appropriate, assumes stack is as it should
|
||||
* be immediately before IRET
|
||||
****************************************************************************
|
||||
*/
|
||||
patch_cf:
|
||||
pushw %bp
|
||||
movw %sp, %bp
|
||||
setc 8(%bp) /* Set/reset CF; clears PF, AF, ZF, SF */
|
||||
popw %bp
|
||||
ret
|
||||
|
||||
/****************************************************************************
|
||||
* INT 15,e820 handler
|
||||
****************************************************************************
|
||||
@@ -500,7 +514,8 @@ int15_e820:
|
||||
popw %ds
|
||||
call get_mangled_e820
|
||||
popw %ds
|
||||
lret $2
|
||||
call patch_cf
|
||||
iret
|
||||
.size int15_e820, . - int15_e820
|
||||
|
||||
/****************************************************************************
|
||||
@@ -512,7 +527,7 @@ int15_e801:
|
||||
/* Call previous handler */
|
||||
pushfw
|
||||
lcall *%cs:int15_vector
|
||||
pushfw
|
||||
call patch_cf
|
||||
/* Edit result */
|
||||
pushw %ds
|
||||
pushw %cs:rm_ds
|
||||
@@ -524,9 +539,7 @@ int15_e801:
|
||||
xchgw %ax, %cx
|
||||
xchgw %bx, %dx
|
||||
popw %ds
|
||||
/* Restore flags returned by previous handler and return */
|
||||
popfw
|
||||
lret $2
|
||||
iret
|
||||
.size int15_e801, . - int15_e801
|
||||
|
||||
/****************************************************************************
|
||||
@@ -538,16 +551,14 @@ int15_88:
|
||||
/* Call previous handler */
|
||||
pushfw
|
||||
lcall *%cs:int15_vector
|
||||
pushfw
|
||||
call patch_cf
|
||||
/* Edit result */
|
||||
pushw %ds
|
||||
pushw %cs:rm_ds
|
||||
popw %ds
|
||||
call patch_1m
|
||||
popw %ds
|
||||
/* Restore flags returned by previous handler and return */
|
||||
popfw
|
||||
lret $2
|
||||
iret
|
||||
.size int15_88, . - int15_88
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <realmode.h>
|
||||
#include <biosint.h>
|
||||
|
||||
@@ -63,6 +65,8 @@ void fake_e820 ( void ) {
|
||||
"cmpl $0x534d4150, %%edx\n\t"
|
||||
"jne 99f\n\t"
|
||||
"pushaw\n\t"
|
||||
"movw %%sp, %%bp\n\t"
|
||||
"andb $~0x01, 22(%%bp)\n\t" /* Clear return CF */
|
||||
"leaw e820map(%%bx), %%si\n\t"
|
||||
"cs rep movsb\n\t"
|
||||
"popaw\n\t"
|
||||
@@ -73,8 +77,7 @@ void fake_e820 ( void ) {
|
||||
"xorl %%ebx,%%ebx\n\t"
|
||||
"\n1:\n\t"
|
||||
"popfw\n\t"
|
||||
"clc\n\t"
|
||||
"lret $2\n\t"
|
||||
"iret\n\t"
|
||||
"\n99:\n\t"
|
||||
"popfw\n\t"
|
||||
"ljmp *%%cs:real_int15_vector\n\t" )
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdio.h>
|
||||
#include <realmode.h>
|
||||
#include <bios.h>
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <assert.h>
|
||||
#include <realmode.h>
|
||||
#include <biosint.h>
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <errno.h>
|
||||
#include <realmode.h>
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#include <gpxe/netdevice.h>
|
||||
#include <gpxe/command.h>
|
||||
#include <hci/ifmgmt_cmd.h>
|
||||
#include <pxe_call.h>
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
static int startpxe_payload ( struct net_device *netdev ) {
|
||||
if ( netdev->state & NETDEV_OPEN )
|
||||
pxe_activate ( netdev );
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int startpxe_exec ( int argc, char **argv ) {
|
||||
return ifcommon_exec ( argc, argv, startpxe_payload,
|
||||
"Activate PXE on" );
|
||||
}
|
||||
|
||||
static int stoppxe_exec ( int argc __unused, char **argv __unused ) {
|
||||
pxe_deactivate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct command pxe_commands[] __command = {
|
||||
{
|
||||
.name = "startpxe",
|
||||
.exec = startpxe_exec,
|
||||
},
|
||||
{
|
||||
.name = "stoppxe",
|
||||
.exec = stoppxe_exec,
|
||||
},
|
||||
};
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
|
||||
+235
-250
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
@@ -42,9 +44,11 @@ FEATURE ( FEATURE_IMAGE, "bzImage", DHCP_EB_FEATURE_BZIMAGE, 1 );
|
||||
struct image_type bzimage_image_type __image_type ( PROBE_NORMAL );
|
||||
|
||||
/**
|
||||
* bzImage load context
|
||||
* bzImage context
|
||||
*/
|
||||
struct bzimage_load_context {
|
||||
struct bzimage_context {
|
||||
/** Boot protocol version */
|
||||
unsigned int version;
|
||||
/** Real-mode kernel portion load segment address */
|
||||
unsigned int rm_kernel_seg;
|
||||
/** Real-mode kernel portion load address */
|
||||
@@ -55,28 +59,14 @@ struct bzimage_load_context {
|
||||
size_t rm_heap;
|
||||
/** Command line (offset from rm_kernel) */
|
||||
size_t rm_cmdline;
|
||||
/** Command line maximum length */
|
||||
size_t cmdline_size;
|
||||
/** Real-mode kernel portion total memory size */
|
||||
size_t rm_memsz;
|
||||
/** Non-real-mode kernel portion load address */
|
||||
userptr_t pm_kernel;
|
||||
/** Non-real-mode kernel portion file and memory size */
|
||||
size_t pm_sz;
|
||||
};
|
||||
|
||||
/**
|
||||
* bzImage execution context
|
||||
*/
|
||||
struct bzimage_exec_context {
|
||||
/** Real-mode kernel portion load segment address */
|
||||
unsigned int rm_kernel_seg;
|
||||
/** Real-mode kernel portion load address */
|
||||
userptr_t rm_kernel;
|
||||
/** Real-mode heap top (offset from rm_kernel) */
|
||||
size_t rm_heap;
|
||||
/** Command line (offset from rm_kernel) */
|
||||
size_t rm_cmdline;
|
||||
/** Command line maximum length */
|
||||
size_t cmdline_size;
|
||||
/** Video mode */
|
||||
unsigned int vid_mode;
|
||||
/** Memory limit */
|
||||
@@ -85,18 +75,178 @@ struct bzimage_exec_context {
|
||||
physaddr_t ramdisk_image;
|
||||
/** Initrd size */
|
||||
physaddr_t ramdisk_size;
|
||||
|
||||
/** Command line magic block */
|
||||
struct bzimage_cmdline cmdline_magic;
|
||||
/** bzImage header */
|
||||
struct bzimage_header bzhdr;
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse bzImage header
|
||||
*
|
||||
* @v image bzImage file
|
||||
* @v bzimg bzImage context
|
||||
* @v src bzImage to parse
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int bzimage_parse_header ( struct image *image,
|
||||
struct bzimage_context *bzimg,
|
||||
userptr_t src ) {
|
||||
unsigned int syssize;
|
||||
int is_bzimage;
|
||||
|
||||
/* Sanity check */
|
||||
if ( image->len < ( BZI_HDR_OFFSET + sizeof ( bzimg->bzhdr ) ) ) {
|
||||
DBGC ( image, "bzImage %p too short for kernel header\n",
|
||||
image );
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
/* Read in header structures */
|
||||
memset ( bzimg, 0, sizeof ( *bzimg ) );
|
||||
copy_from_user ( &bzimg->cmdline_magic, src, BZI_CMDLINE_OFFSET,
|
||||
sizeof ( bzimg->cmdline_magic ) );
|
||||
copy_from_user ( &bzimg->bzhdr, src, BZI_HDR_OFFSET,
|
||||
sizeof ( bzimg->bzhdr ) );
|
||||
|
||||
/* Calculate size of real-mode portion */
|
||||
bzimg->rm_filesz =
|
||||
( ( bzimg->bzhdr.setup_sects ? bzimg->bzhdr.setup_sects : 4 ) + 1 ) << 9;
|
||||
if ( bzimg->rm_filesz > image->len ) {
|
||||
DBGC ( image, "bzImage %p too short for %zd byte of setup\n",
|
||||
image, bzimg->rm_filesz );
|
||||
return -ENOEXEC;
|
||||
}
|
||||
bzimg->rm_memsz = BZI_ASSUMED_RM_SIZE;
|
||||
|
||||
/* Calculate size of protected-mode portion */
|
||||
bzimg->pm_sz = ( image->len - bzimg->rm_filesz );
|
||||
syssize = ( ( bzimg->pm_sz + 15 ) / 16 );
|
||||
|
||||
/* Check for signatures and determine version */
|
||||
if ( bzimg->bzhdr.boot_flag != BZI_BOOT_FLAG ) {
|
||||
DBGC ( image, "bzImage %p missing 55AA signature\n", image );
|
||||
return -ENOEXEC;
|
||||
}
|
||||
if ( bzimg->bzhdr.header == BZI_SIGNATURE ) {
|
||||
/* 2.00+ */
|
||||
bzimg->version = bzimg->bzhdr.version;
|
||||
} else {
|
||||
/* Pre-2.00. Check that the syssize field is correct,
|
||||
* as a guard against accepting arbitrary binary data,
|
||||
* since the 55AA check is pretty lax. Note that the
|
||||
* syssize field is unreliable for protocols between
|
||||
* 2.00 and 2.03 inclusive, so we should not always
|
||||
* check this field.
|
||||
*/
|
||||
bzimg->version = 0x0100;
|
||||
if ( bzimg->bzhdr.syssize != syssize ) {
|
||||
DBGC ( image, "bzImage %p bad syssize %x (expected "
|
||||
"%x)\n", image, bzimg->bzhdr.syssize, syssize );
|
||||
return -ENOEXEC;
|
||||
}
|
||||
}
|
||||
|
||||
/* Determine image type */
|
||||
is_bzimage = ( ( bzimg->version >= 0x0200 ) ?
|
||||
( bzimg->bzhdr.loadflags & BZI_LOAD_HIGH ) : 0 );
|
||||
|
||||
/* Calculate load address of real-mode portion */
|
||||
bzimg->rm_kernel_seg = ( is_bzimage ? 0x1000 : 0x9000 );
|
||||
bzimg->rm_kernel = real_to_user ( bzimg->rm_kernel_seg, 0 );
|
||||
|
||||
/* Allow space for the stack and heap */
|
||||
bzimg->rm_memsz += BZI_STACK_SIZE;
|
||||
bzimg->rm_heap = bzimg->rm_memsz;
|
||||
|
||||
/* Allow space for the command line */
|
||||
bzimg->rm_cmdline = bzimg->rm_memsz;
|
||||
bzimg->rm_memsz += BZI_CMDLINE_SIZE;
|
||||
|
||||
/* Calculate load address of protected-mode portion */
|
||||
bzimg->pm_kernel = phys_to_user ( is_bzimage ? BZI_LOAD_HIGH_ADDR
|
||||
: BZI_LOAD_LOW_ADDR );
|
||||
|
||||
/* Extract video mode */
|
||||
bzimg->vid_mode = bzimg->bzhdr.vid_mode;
|
||||
|
||||
/* Extract memory limit */
|
||||
bzimg->mem_limit = ( ( bzimg->version >= 0x0203 ) ?
|
||||
bzimg->bzhdr.initrd_addr_max : BZI_INITRD_MAX );
|
||||
|
||||
/* Extract command line size */
|
||||
bzimg->cmdline_size = ( ( bzimg->version >= 0x0206 ) ?
|
||||
bzimg->bzhdr.cmdline_size : BZI_CMDLINE_SIZE );
|
||||
|
||||
DBGC ( image, "bzImage %p version %04x RM %#lx+%#zx PM %#lx+%#zx "
|
||||
"cmdlen %zd\n", image, bzimg->version,
|
||||
user_to_phys ( bzimg->rm_kernel, 0 ), bzimg->rm_filesz,
|
||||
user_to_phys ( bzimg->pm_kernel, 0 ), bzimg->pm_sz,
|
||||
bzimg->cmdline_size );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update bzImage header in loaded kernel
|
||||
*
|
||||
* @v image bzImage file
|
||||
* @v bzimg bzImage context
|
||||
* @v dst bzImage to update
|
||||
*/
|
||||
static void bzimage_update_header ( struct image *image,
|
||||
struct bzimage_context *bzimg,
|
||||
userptr_t dst ) {
|
||||
|
||||
/* Set loader type */
|
||||
if ( bzimg->version >= 0x0200 )
|
||||
bzimg->bzhdr.type_of_loader = BZI_LOADER_TYPE_GPXE;
|
||||
|
||||
/* Set heap end pointer */
|
||||
if ( bzimg->version >= 0x0201 ) {
|
||||
bzimg->bzhdr.heap_end_ptr = ( bzimg->rm_heap - 0x200 );
|
||||
bzimg->bzhdr.loadflags |= BZI_CAN_USE_HEAP;
|
||||
}
|
||||
|
||||
/* Set command line */
|
||||
if ( bzimg->version >= 0x0202 ) {
|
||||
bzimg->bzhdr.cmd_line_ptr = user_to_phys ( bzimg->rm_kernel,
|
||||
bzimg->rm_cmdline );
|
||||
} else {
|
||||
bzimg->cmdline_magic.magic = BZI_CMDLINE_MAGIC;
|
||||
bzimg->cmdline_magic.offset = bzimg->rm_cmdline;
|
||||
bzimg->bzhdr.setup_move_size = bzimg->rm_memsz;
|
||||
}
|
||||
|
||||
/* Set video mode */
|
||||
bzimg->bzhdr.vid_mode = bzimg->vid_mode;
|
||||
|
||||
/* Set initrd address */
|
||||
if ( bzimg->version >= 0x0200 ) {
|
||||
bzimg->bzhdr.ramdisk_image = bzimg->ramdisk_image;
|
||||
bzimg->bzhdr.ramdisk_size = bzimg->ramdisk_size;
|
||||
}
|
||||
|
||||
/* Write out header structures */
|
||||
copy_to_user ( dst, BZI_CMDLINE_OFFSET, &bzimg->cmdline_magic,
|
||||
sizeof ( bzimg->cmdline_magic ) );
|
||||
copy_to_user ( dst, BZI_HDR_OFFSET, &bzimg->bzhdr,
|
||||
sizeof ( bzimg->bzhdr ) );
|
||||
|
||||
DBGC ( image, "bzImage %p vidmode %d\n", image, bzimg->vid_mode );
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse kernel command line for bootloader parameters
|
||||
*
|
||||
* @v image bzImage file
|
||||
* @v exec_ctx Execution context
|
||||
* @v bzimg bzImage context
|
||||
* @v cmdline Kernel command line
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int bzimage_parse_cmdline ( struct image *image,
|
||||
struct bzimage_exec_context *exec_ctx,
|
||||
struct bzimage_context *bzimg,
|
||||
const char *cmdline ) {
|
||||
char *vga;
|
||||
char *mem;
|
||||
@@ -105,13 +255,13 @@ static int bzimage_parse_cmdline ( struct image *image,
|
||||
if ( ( vga = strstr ( cmdline, "vga=" ) ) ) {
|
||||
vga += 4;
|
||||
if ( strcmp ( vga, "normal" ) == 0 ) {
|
||||
exec_ctx->vid_mode = BZI_VID_MODE_NORMAL;
|
||||
bzimg->vid_mode = BZI_VID_MODE_NORMAL;
|
||||
} else if ( strcmp ( vga, "ext" ) == 0 ) {
|
||||
exec_ctx->vid_mode = BZI_VID_MODE_EXT;
|
||||
bzimg->vid_mode = BZI_VID_MODE_EXT;
|
||||
} else if ( strcmp ( vga, "ask" ) == 0 ) {
|
||||
exec_ctx->vid_mode = BZI_VID_MODE_ASK;
|
||||
bzimg->vid_mode = BZI_VID_MODE_ASK;
|
||||
} else {
|
||||
exec_ctx->vid_mode = strtoul ( vga, &vga, 0 );
|
||||
bzimg->vid_mode = strtoul ( vga, &vga, 0 );
|
||||
if ( *vga && ( *vga != ' ' ) ) {
|
||||
DBGC ( image, "bzImage %p strange \"vga=\""
|
||||
"terminator '%c'\n", image, *vga );
|
||||
@@ -122,17 +272,17 @@ static int bzimage_parse_cmdline ( struct image *image,
|
||||
/* Look for "mem=" */
|
||||
if ( ( mem = strstr ( cmdline, "mem=" ) ) ) {
|
||||
mem += 4;
|
||||
exec_ctx->mem_limit = strtoul ( mem, &mem, 0 );
|
||||
bzimg->mem_limit = strtoul ( mem, &mem, 0 );
|
||||
switch ( *mem ) {
|
||||
case 'G':
|
||||
case 'g':
|
||||
exec_ctx->mem_limit <<= 10;
|
||||
bzimg->mem_limit <<= 10;
|
||||
case 'M':
|
||||
case 'm':
|
||||
exec_ctx->mem_limit <<= 10;
|
||||
bzimg->mem_limit <<= 10;
|
||||
case 'K':
|
||||
case 'k':
|
||||
exec_ctx->mem_limit <<= 10;
|
||||
bzimg->mem_limit <<= 10;
|
||||
break;
|
||||
case '\0':
|
||||
case ' ':
|
||||
@@ -142,7 +292,7 @@ static int bzimage_parse_cmdline ( struct image *image,
|
||||
"terminator '%c'\n", image, *mem );
|
||||
break;
|
||||
}
|
||||
exec_ctx->mem_limit -= 1;
|
||||
bzimg->mem_limit -= 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -152,20 +302,20 @@ static int bzimage_parse_cmdline ( struct image *image,
|
||||
* Set command line
|
||||
*
|
||||
* @v image bzImage image
|
||||
* @v exec_ctx Execution context
|
||||
* @v bzimg bzImage context
|
||||
* @v cmdline Kernel command line
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int bzimage_set_cmdline ( struct image *image,
|
||||
struct bzimage_exec_context *exec_ctx,
|
||||
struct bzimage_context *bzimg,
|
||||
const char *cmdline ) {
|
||||
size_t cmdline_len;
|
||||
|
||||
/* Copy command line down to real-mode portion */
|
||||
cmdline_len = ( strlen ( cmdline ) + 1 );
|
||||
if ( cmdline_len > exec_ctx->cmdline_size )
|
||||
cmdline_len = exec_ctx->cmdline_size;
|
||||
copy_to_user ( exec_ctx->rm_kernel, exec_ctx->rm_cmdline,
|
||||
if ( cmdline_len > bzimg->cmdline_size )
|
||||
cmdline_len = bzimg->cmdline_size;
|
||||
copy_to_user ( bzimg->rm_kernel, bzimg->rm_cmdline,
|
||||
cmdline, cmdline_len );
|
||||
DBGC ( image, "bzImage %p command line \"%s\"\n", image, cmdline );
|
||||
|
||||
@@ -217,14 +367,16 @@ static size_t bzimage_load_initrd ( struct image *image,
|
||||
}
|
||||
|
||||
/* Copy in initrd image body */
|
||||
if ( address )
|
||||
memcpy_user ( address, offset, initrd->data, 0, initrd->len );
|
||||
offset += initrd->len;
|
||||
if ( address ) {
|
||||
DBGC ( image, "bzImage %p has initrd %p at [%lx,%lx)\n",
|
||||
image, initrd, address, ( address + offset ) );
|
||||
memcpy_user ( address, offset, initrd->data, 0,
|
||||
initrd->len );
|
||||
image, initrd, user_to_phys ( address, 0 ),
|
||||
user_to_phys ( address, offset ) );
|
||||
}
|
||||
offset += initrd->len;
|
||||
|
||||
/* Round up to 4-byte boundary */
|
||||
offset = ( ( offset + 0x03 ) & ~0x03 );
|
||||
return offset;
|
||||
}
|
||||
@@ -233,20 +385,19 @@ static size_t bzimage_load_initrd ( struct image *image,
|
||||
* Load initrds, if any
|
||||
*
|
||||
* @v image bzImage image
|
||||
* @v exec_ctx Execution context
|
||||
* @v bzimg bzImage context
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int bzimage_load_initrds ( struct image *image,
|
||||
struct bzimage_exec_context *exec_ctx ) {
|
||||
struct bzimage_context *bzimg ) {
|
||||
struct image *initrd;
|
||||
size_t total_len = 0;
|
||||
physaddr_t address;
|
||||
int rc;
|
||||
|
||||
/* Add up length of all initrd images */
|
||||
for_each_image ( initrd ) {
|
||||
for_each_image ( initrd )
|
||||
total_len += bzimage_load_initrd ( image, initrd, UNULL );
|
||||
}
|
||||
|
||||
/* Give up if no initrd images found */
|
||||
if ( ! total_len )
|
||||
@@ -268,7 +419,7 @@ static int bzimage_load_initrds ( struct image *image,
|
||||
return -ENOBUFS;
|
||||
}
|
||||
/* Check that we are within the kernel's range */
|
||||
if ( ( address + total_len - 1 ) > exec_ctx->mem_limit )
|
||||
if ( ( address + total_len - 1 ) > bzimg->mem_limit )
|
||||
continue;
|
||||
/* Prepare and verify segment */
|
||||
if ( ( rc = prep_segment ( phys_to_user ( address ), 0,
|
||||
@@ -279,8 +430,8 @@ static int bzimage_load_initrds ( struct image *image,
|
||||
}
|
||||
|
||||
/* Record initrd location */
|
||||
exec_ctx->ramdisk_image = address;
|
||||
exec_ctx->ramdisk_size = total_len;
|
||||
bzimg->ramdisk_image = address;
|
||||
bzimg->ramdisk_size = total_len;
|
||||
|
||||
/* Construct initrd */
|
||||
DBGC ( image, "bzImage %p constructing initrd at [%lx,%lx)\n",
|
||||
@@ -300,60 +451,37 @@ static int bzimage_load_initrds ( struct image *image,
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int bzimage_exec ( struct image *image ) {
|
||||
struct bzimage_exec_context exec_ctx;
|
||||
struct bzimage_header bzhdr;
|
||||
struct bzimage_context bzimg;
|
||||
const char *cmdline = ( image->cmdline ? image->cmdline : "" );
|
||||
int rc;
|
||||
|
||||
/* Initialise context */
|
||||
memset ( &exec_ctx, 0, sizeof ( exec_ctx ) );
|
||||
|
||||
/* Retrieve kernel header */
|
||||
exec_ctx.rm_kernel_seg = image->priv.ul;
|
||||
exec_ctx.rm_kernel = real_to_user ( exec_ctx.rm_kernel_seg, 0 );
|
||||
copy_from_user ( &bzhdr, exec_ctx.rm_kernel, BZI_HDR_OFFSET,
|
||||
sizeof ( bzhdr ) );
|
||||
exec_ctx.rm_cmdline = exec_ctx.rm_heap =
|
||||
( bzhdr.heap_end_ptr + 0x200 );
|
||||
exec_ctx.vid_mode = bzhdr.vid_mode;
|
||||
if ( bzhdr.version >= 0x0203 ) {
|
||||
exec_ctx.mem_limit = bzhdr.initrd_addr_max;
|
||||
} else {
|
||||
exec_ctx.mem_limit = BZI_INITRD_MAX;
|
||||
}
|
||||
if ( bzhdr.version >= 0x0206 ) {
|
||||
exec_ctx.cmdline_size = bzhdr.cmdline_size;
|
||||
} else {
|
||||
exec_ctx.cmdline_size = BZI_CMDLINE_SIZE;
|
||||
}
|
||||
DBG ( "cmdline_size = %zd\n", exec_ctx.cmdline_size );
|
||||
/* Read and parse header from loaded kernel */
|
||||
if ( ( rc = bzimage_parse_header ( image, &bzimg,
|
||||
image->priv.user ) ) != 0 )
|
||||
return rc;
|
||||
assert ( bzimg.rm_kernel == image->priv.user );
|
||||
|
||||
/* Parse command line for bootloader parameters */
|
||||
if ( ( rc = bzimage_parse_cmdline ( image, &exec_ctx, cmdline ) ) != 0)
|
||||
if ( ( rc = bzimage_parse_cmdline ( image, &bzimg, cmdline ) ) != 0)
|
||||
return rc;
|
||||
|
||||
/* Store command line */
|
||||
if ( ( rc = bzimage_set_cmdline ( image, &exec_ctx, cmdline ) ) != 0 )
|
||||
if ( ( rc = bzimage_set_cmdline ( image, &bzimg, cmdline ) ) != 0 )
|
||||
return rc;
|
||||
|
||||
/* Load any initrds */
|
||||
if ( ( rc = bzimage_load_initrds ( image, &exec_ctx ) ) != 0 )
|
||||
if ( ( rc = bzimage_load_initrds ( image, &bzimg ) ) != 0 )
|
||||
return rc;
|
||||
|
||||
/* Update and store kernel header */
|
||||
bzhdr.vid_mode = exec_ctx.vid_mode;
|
||||
bzhdr.ramdisk_image = exec_ctx.ramdisk_image;
|
||||
bzhdr.ramdisk_size = exec_ctx.ramdisk_size;
|
||||
copy_to_user ( exec_ctx.rm_kernel, BZI_HDR_OFFSET, &bzhdr,
|
||||
sizeof ( bzhdr ) );
|
||||
/* Update kernel header */
|
||||
bzimage_update_header ( image, &bzimg, bzimg.rm_kernel );
|
||||
|
||||
/* Prepare for exiting */
|
||||
shutdown ( SHUTDOWN_BOOT );
|
||||
|
||||
DBGC ( image, "bzImage %p jumping to RM kernel at %04x:0000 "
|
||||
"(stack %04x:%04zx)\n", image,
|
||||
( exec_ctx.rm_kernel_seg + 0x20 ),
|
||||
exec_ctx.rm_kernel_seg, exec_ctx.rm_heap );
|
||||
"(stack %04x:%04zx)\n", image, ( bzimg.rm_kernel_seg + 0x20 ),
|
||||
bzimg.rm_kernel_seg, bzimg.rm_heap );
|
||||
|
||||
/* Jump to the kernel */
|
||||
__asm__ __volatile__ ( REAL_CODE ( "movw %w0, %%ds\n\t"
|
||||
@@ -365,9 +493,9 @@ static int bzimage_exec ( struct image *image ) {
|
||||
"pushw %w2\n\t"
|
||||
"pushw $0\n\t"
|
||||
"lret\n\t" )
|
||||
: : "r" ( exec_ctx.rm_kernel_seg ),
|
||||
"r" ( exec_ctx.rm_heap ),
|
||||
"r" ( exec_ctx.rm_kernel_seg + 0x20 ) );
|
||||
: : "r" ( bzimg.rm_kernel_seg ),
|
||||
"r" ( bzimg.rm_heap ),
|
||||
"r" ( bzimg.rm_kernel_seg + 0x20 ) );
|
||||
|
||||
/* There is no way for the image to return, since we provide
|
||||
* no return address.
|
||||
@@ -377,157 +505,6 @@ static int bzimage_exec ( struct image *image ) {
|
||||
return -ECANCELED; /* -EIMPOSSIBLE */
|
||||
}
|
||||
|
||||
/**
|
||||
* Load and parse bzImage header
|
||||
*
|
||||
* @v image bzImage file
|
||||
* @v load_ctx Load context
|
||||
* @v bzhdr Buffer for bzImage header
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int bzimage_load_header ( struct image *image,
|
||||
struct bzimage_load_context *load_ctx,
|
||||
struct bzimage_header *bzhdr ) {
|
||||
|
||||
/* Sanity check */
|
||||
if ( image->len < ( BZI_HDR_OFFSET + sizeof ( *bzhdr ) ) ) {
|
||||
DBGC ( image, "bzImage %p too short for kernel header\n",
|
||||
image );
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
/* Read and verify header */
|
||||
copy_from_user ( bzhdr, image->data, BZI_HDR_OFFSET,
|
||||
sizeof ( *bzhdr ) );
|
||||
if ( bzhdr->header != BZI_SIGNATURE ) {
|
||||
DBGC ( image, "bzImage %p bad signature %08x\n",
|
||||
image, bzhdr->header );
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
/* We don't support ancient kernels */
|
||||
if ( bzhdr->version < 0x0200 ) {
|
||||
DBGC ( image, "bzImage %p version %04x not supported\n",
|
||||
image, bzhdr->version );
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/* Calculate load address and size of real-mode portion */
|
||||
load_ctx->rm_kernel_seg = ( ( bzhdr->loadflags & BZI_LOAD_HIGH ) ?
|
||||
0x1000 : /* 1000:0000 (bzImage) */
|
||||
0x9000 ); /* 9000:0000 (zImage) */
|
||||
load_ctx->rm_kernel = real_to_user ( load_ctx->rm_kernel_seg, 0 );
|
||||
load_ctx->rm_filesz =
|
||||
( ( bzhdr->setup_sects ? bzhdr->setup_sects : 4 ) + 1 ) << 9;
|
||||
load_ctx->rm_memsz = BZI_ASSUMED_RM_SIZE;
|
||||
if ( load_ctx->rm_filesz > image->len ) {
|
||||
DBGC ( image, "bzImage %p too short for %zd byte of setup\n",
|
||||
image, load_ctx->rm_filesz );
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
/* Calculate load address and size of non-real-mode portion */
|
||||
load_ctx->pm_kernel = ( ( bzhdr->loadflags & BZI_LOAD_HIGH ) ?
|
||||
phys_to_user ( BZI_LOAD_HIGH_ADDR ) :
|
||||
phys_to_user ( BZI_LOAD_LOW_ADDR ) );
|
||||
load_ctx->pm_sz = ( image->len - load_ctx->rm_filesz );
|
||||
|
||||
DBGC ( image, "bzImage %p version %04x RM %#zx bytes PM %#zx bytes\n",
|
||||
image, bzhdr->version, load_ctx->rm_filesz, load_ctx->pm_sz );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load real-mode portion of bzImage
|
||||
*
|
||||
* @v image bzImage file
|
||||
* @v load_ctx Load context
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int bzimage_load_real ( struct image *image,
|
||||
struct bzimage_load_context *load_ctx ) {
|
||||
int rc;
|
||||
|
||||
/* Allow space for the stack and heap */
|
||||
load_ctx->rm_memsz += BZI_STACK_SIZE;
|
||||
load_ctx->rm_heap = load_ctx->rm_memsz;
|
||||
|
||||
/* Allow space for the command line */
|
||||
load_ctx->rm_cmdline = load_ctx->rm_memsz;
|
||||
load_ctx->rm_memsz += BZI_CMDLINE_SIZE;
|
||||
|
||||
/* Prepare, verify, and load the real-mode segment */
|
||||
if ( ( rc = prep_segment ( load_ctx->rm_kernel, load_ctx->rm_filesz,
|
||||
load_ctx->rm_memsz ) ) != 0 ) {
|
||||
DBGC ( image, "bzImage %p could not prepare RM segment: %s\n",
|
||||
image, strerror ( rc ) );
|
||||
return rc;
|
||||
}
|
||||
memcpy_user ( load_ctx->rm_kernel, 0, image->data, 0,
|
||||
load_ctx->rm_filesz );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load non-real-mode portion of bzImage
|
||||
*
|
||||
* @v image bzImage file
|
||||
* @v load_ctx Load context
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int bzimage_load_non_real ( struct image *image,
|
||||
struct bzimage_load_context *load_ctx ) {
|
||||
int rc;
|
||||
|
||||
/* Prepare, verify and load the non-real-mode segment */
|
||||
if ( ( rc = prep_segment ( load_ctx->pm_kernel, load_ctx->pm_sz,
|
||||
load_ctx->pm_sz ) ) != 0 ) {
|
||||
DBGC ( image, "bzImage %p could not prepare PM segment: %s\n",
|
||||
image, strerror ( rc ) );
|
||||
return rc;
|
||||
}
|
||||
memcpy_user ( load_ctx->pm_kernel, 0, image->data, load_ctx->rm_filesz,
|
||||
load_ctx->pm_sz );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update and store bzImage header
|
||||
*
|
||||
* @v image bzImage file
|
||||
* @v load_ctx Load context
|
||||
* @v bzhdr Original bzImage header
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int bzimage_write_header ( struct image *image __unused,
|
||||
struct bzimage_load_context *load_ctx,
|
||||
struct bzimage_header *bzhdr ) {
|
||||
struct bzimage_cmdline cmdline;
|
||||
|
||||
/* Update the header and copy it into the loaded kernel */
|
||||
bzhdr->type_of_loader = BZI_LOADER_TYPE_GPXE;
|
||||
if ( bzhdr->version >= 0x0201 ) {
|
||||
bzhdr->heap_end_ptr = ( load_ctx->rm_heap - 0x200 );
|
||||
bzhdr->loadflags |= BZI_CAN_USE_HEAP;
|
||||
}
|
||||
if ( bzhdr->version >= 0x0202 ) {
|
||||
bzhdr->cmd_line_ptr = user_to_phys ( load_ctx->rm_kernel,
|
||||
load_ctx->rm_cmdline );
|
||||
} else {
|
||||
cmdline.magic = BZI_CMDLINE_MAGIC;
|
||||
cmdline.offset = load_ctx->rm_cmdline;
|
||||
copy_to_user ( load_ctx->rm_kernel, BZI_CMDLINE_OFFSET,
|
||||
&cmdline, sizeof ( cmdline ) );
|
||||
bzhdr->setup_move_size = load_ctx->rm_memsz;
|
||||
}
|
||||
copy_to_user ( load_ctx->rm_kernel, BZI_HDR_OFFSET,
|
||||
bzhdr, sizeof ( *bzhdr ) );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load bzImage image into memory
|
||||
*
|
||||
@@ -535,35 +512,43 @@ static int bzimage_write_header ( struct image *image __unused,
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
int bzimage_load ( struct image *image ) {
|
||||
struct bzimage_load_context load_ctx;
|
||||
struct bzimage_header bzhdr;
|
||||
struct bzimage_context bzimg;
|
||||
int rc;
|
||||
|
||||
/* Initialise context */
|
||||
memset ( &load_ctx, 0, sizeof ( load_ctx ) );
|
||||
|
||||
/* Load and verify header */
|
||||
if ( ( rc = bzimage_load_header ( image, &load_ctx, &bzhdr ) ) != 0 )
|
||||
/* Read and parse header from image */
|
||||
if ( ( rc = bzimage_parse_header ( image, &bzimg,
|
||||
image->data ) ) != 0 )
|
||||
return rc;
|
||||
|
||||
/* This is a bzImage image, valid or otherwise */
|
||||
if ( ! image->type )
|
||||
image->type = &bzimage_image_type;
|
||||
|
||||
/* Load real-mode portion */
|
||||
if ( ( rc = bzimage_load_real ( image, &load_ctx ) ) != 0 )
|
||||
/* Prepare segments */
|
||||
if ( ( rc = prep_segment ( bzimg.rm_kernel, bzimg.rm_filesz,
|
||||
bzimg.rm_memsz ) ) != 0 ) {
|
||||
DBGC ( image, "bzImage %p could not prepare RM segment: %s\n",
|
||||
image, strerror ( rc ) );
|
||||
return rc;
|
||||
}
|
||||
if ( ( rc = prep_segment ( bzimg.pm_kernel, bzimg.pm_sz,
|
||||
bzimg.pm_sz ) ) != 0 ) {
|
||||
DBGC ( image, "bzImage %p could not prepare PM segment: %s\n",
|
||||
image, strerror ( rc ) );
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Load non-real-mode portion */
|
||||
if ( ( rc = bzimage_load_non_real ( image, &load_ctx ) ) != 0 )
|
||||
return rc;
|
||||
/* Load segments */
|
||||
memcpy_user ( bzimg.rm_kernel, 0, image->data,
|
||||
0, bzimg.rm_filesz );
|
||||
memcpy_user ( bzimg.pm_kernel, 0, image->data,
|
||||
bzimg.rm_filesz, bzimg.pm_sz );
|
||||
|
||||
/* Update and write out header */
|
||||
if ( ( rc = bzimage_write_header ( image, &load_ctx, &bzhdr ) ) != 0 )
|
||||
return rc;
|
||||
bzimage_update_header ( image, &bzimg, bzimg.rm_kernel );
|
||||
|
||||
/* Record real-mode segment in image private data field */
|
||||
image->priv.ul = load_ctx.rm_kernel_seg;
|
||||
image->priv.user = bzimg.rm_kernel;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <errno.h>
|
||||
#include <elf.h>
|
||||
#include <gpxe/image.h>
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
@@ -139,10 +141,11 @@ static void multiboot_build_memmap ( struct image *image,
|
||||
/**
|
||||
* Add command line in base memory
|
||||
*
|
||||
* @v imgname Image name
|
||||
* @v cmdline Command line
|
||||
* @ret physaddr Physical address of command line
|
||||
*/
|
||||
physaddr_t multiboot_add_cmdline ( const char *cmdline ) {
|
||||
physaddr_t multiboot_add_cmdline ( const char *imgname, const char *cmdline ) {
|
||||
char *mb_cmdline;
|
||||
|
||||
if ( ! cmdline )
|
||||
@@ -153,7 +156,7 @@ physaddr_t multiboot_add_cmdline ( const char *cmdline ) {
|
||||
mb_cmdline_offset +=
|
||||
( snprintf ( mb_cmdline,
|
||||
( sizeof ( mb_cmdlines ) - mb_cmdline_offset ),
|
||||
"%s", cmdline ) + 1 );
|
||||
"%s %s", imgname, cmdline ) + 1 );
|
||||
|
||||
/* Truncate to terminating NUL in buffer if necessary */
|
||||
if ( mb_cmdline_offset > sizeof ( mb_cmdlines ) )
|
||||
@@ -208,8 +211,8 @@ multiboot_build_module_list ( struct image *image,
|
||||
( ( count - insert ) * sizeof ( *module ) ) );
|
||||
module->mod_start = start;
|
||||
module->mod_end = end;
|
||||
module->string =
|
||||
multiboot_add_cmdline ( module_image->cmdline );
|
||||
module->string = multiboot_add_cmdline ( module_image->name,
|
||||
module_image->cmdline );
|
||||
module->reserved = 0;
|
||||
|
||||
/* We promise to page-align modules */
|
||||
@@ -267,7 +270,7 @@ static int multiboot_exec ( struct image *image ) {
|
||||
multiboot_build_memmap ( image, &mbinfo, mbmemmap,
|
||||
( sizeof(mbmemmap) / sizeof(mbmemmap[0]) ) );
|
||||
mb_cmdline_offset = 0;
|
||||
mbinfo.cmdline = multiboot_add_cmdline ( image->cmdline );
|
||||
mbinfo.cmdline = multiboot_add_cmdline ( image->name, image->cmdline );
|
||||
mbinfo.mods_count = multiboot_build_module_list ( image, mbmodules,
|
||||
( sizeof(mbmodules) / sizeof(mbmodules[0]) ) );
|
||||
mbinfo.mods_addr = virt_to_phys ( mbmodules );
|
||||
@@ -360,6 +363,13 @@ static int multiboot_load_raw ( struct image *image,
|
||||
userptr_t buffer;
|
||||
int rc;
|
||||
|
||||
/* Sanity check */
|
||||
if ( ! ( hdr->mb.flags & MB_FLAG_RAW ) ) {
|
||||
DBGC ( image, "MULTIBOOT %p is not flagged as a raw image\n",
|
||||
image );
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Verify and prepare segment */
|
||||
offset = ( hdr->offset - hdr->mb.header_addr + hdr->mb.load_addr );
|
||||
filesz = ( hdr->mb.load_end_addr ?
|
||||
@@ -432,14 +442,14 @@ static int multiboot_load ( struct image *image ) {
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
/* Load the actual image */
|
||||
if ( hdr.mb.flags & MB_FLAG_RAW ) {
|
||||
if ( ( rc = multiboot_load_raw ( image, &hdr ) ) != 0 )
|
||||
return rc;
|
||||
} else {
|
||||
if ( ( rc = multiboot_load_elf ( image ) ) != 0 )
|
||||
return rc;
|
||||
}
|
||||
/* There is technically a bit MB_FLAG_RAW to indicate whether
|
||||
* this is an ELF or a raw image. In practice, grub will use
|
||||
* the ELF header if present, and Solaris relies on this
|
||||
* behaviour.
|
||||
*/
|
||||
if ( ( ( rc = multiboot_load_elf ( image ) ) != 0 ) &&
|
||||
( ( rc = multiboot_load_raw ( image, &hdr ) ) != 0 ) )
|
||||
return rc;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
@@ -42,28 +44,24 @@ struct image_type pxe_image_type __image_type ( PROBE_PXE );
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int pxe_exec ( struct image *image ) {
|
||||
struct net_device *netdev;
|
||||
int rc;
|
||||
|
||||
/* Ensure that PXE stack is ready to use */
|
||||
pxe_init_structures();
|
||||
pxe_hook_int1a();
|
||||
|
||||
/* Arbitrarily pick the most recently opened network device */
|
||||
pxe_set_netdev ( last_opened_netdev() );
|
||||
|
||||
/* Many things will break if pxe_netdev is NULL */
|
||||
if ( ! pxe_netdev ) {
|
||||
if ( ( netdev = last_opened_netdev() ) == NULL ) {
|
||||
DBGC ( image, "IMAGE %p could not locate PXE net device\n",
|
||||
image );
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Activate PXE */
|
||||
pxe_activate ( netdev );
|
||||
|
||||
/* Start PXE NBP */
|
||||
rc = pxe_start_nbp();
|
||||
|
||||
/* Deactivate PXE */
|
||||
pxe_set_netdev ( NULL );
|
||||
pxe_unhook_int1a();
|
||||
pxe_deactivate();
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <realmode.h>
|
||||
#include <bios.h>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef BASEMEM_PACKET_H
|
||||
#define BASEMEM_PACKET_H
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <realmode.h>
|
||||
|
||||
/** Maximum length of base memory packet buffer */
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef BIOS_H
|
||||
#define BIOS_H
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#define BDA_SEG 0x0040
|
||||
#define BDA_FBMS 0x0013
|
||||
#define BDA_NUM_DRIVES 0x0075
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <realmode.h>
|
||||
|
||||
struct segoff;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef ETHERBOOT_BITS_BYTESWAP_H
|
||||
#define ETHERBOOT_BITS_BYTESWAP_H
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
static inline __attribute__ ((always_inline, const)) uint16_t
|
||||
__bswap_variable_16(uint16_t x)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef _BITS_COMPILER_H
|
||||
#define _BITS_COMPILER_H
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#ifndef ASSEMBLY
|
||||
|
||||
/** Declare a function with standard calling conventions */
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef ETHERBOOT_BITS_ENDIAN_H
|
||||
#define ETHERBOOT_BITS_ENDIAN_H
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#define __BYTE_ORDER __LITTLE_ENDIAN
|
||||
|
||||
#endif /* ETHERBOOT_BITS_ENDIAN_H */
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef _BITS_ERRFILE_H
|
||||
#define _BITS_ERRFILE_H
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/**
|
||||
* @addtogroup errfile Error file identifiers
|
||||
* @{
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <gpxe/x86_io.h>
|
||||
|
||||
#endif /* _BITS_IO_H */
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <gpxe/bios_nap.h>
|
||||
#include <gpxe/efi/efix86_nap.h>
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <gpxe/bios_smbios.h>
|
||||
|
||||
#endif /* _BITS_SMBIOS_H */
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
#ifndef _BITS_STDINT_H
|
||||
#define _BITS_STDINT_H
|
||||
|
||||
typedef unsigned int size_t;
|
||||
typedef signed int ssize_t;
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
typedef __SIZE_TYPE__ size_t;
|
||||
typedef signed long ssize_t;
|
||||
typedef signed long off_t;
|
||||
|
||||
typedef unsigned char uint8_t;
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <gpxe/bios_timer.h>
|
||||
#include <gpxe/rdtsc_timer.h>
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <librm.h>
|
||||
|
||||
#endif /* _BITS_UACCESS_H */
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <gpxe/memtop_umalloc.h>
|
||||
|
||||
#endif /* _BITS_UMALLOC_H */
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
* x86 bootsector image format
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
extern int call_bootsector ( unsigned int segment, unsigned int offset,
|
||||
unsigned int drive );
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef _BZIMAGE_H
|
||||
#define _BZIMAGE_H
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
@@ -75,6 +77,9 @@ struct bzimage_header {
|
||||
/** Offset of bzImage header within kernel image */
|
||||
#define BZI_HDR_OFFSET 0x1f1
|
||||
|
||||
/** bzImage boot flag value */
|
||||
#define BZI_BOOT_FLAG 0xaa55
|
||||
|
||||
/** bzImage magic signature value */
|
||||
#define BZI_SIGNATURE 0x53726448
|
||||
|
||||
|
||||
@@ -1,243 +0,0 @@
|
||||
/* Callout/callback interface for Etherboot
|
||||
*
|
||||
* This file provides the mechanisms for making calls from Etherboot
|
||||
* to external programs and vice-versa.
|
||||
*
|
||||
* Initial version by Michael Brown <mbrown@fensystems.co.uk>, January 2004.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef CALLBACKS_ARCH_H
|
||||
#define CALLBACKS_ARCH_H
|
||||
|
||||
/* Skip the definitions that won't make sense to the assembler */
|
||||
#ifndef ASSEMBLY
|
||||
|
||||
/* Struct to hold general-purpose register values. PUSHAL and POPAL
|
||||
* can work directly with this structure; do not change the order of
|
||||
* registers.
|
||||
*/
|
||||
typedef struct {
|
||||
union {
|
||||
uint16_t di;
|
||||
uint32_t edi;
|
||||
};
|
||||
union {
|
||||
uint16_t si;
|
||||
uint32_t esi;
|
||||
};
|
||||
union {
|
||||
uint16_t bp;
|
||||
uint32_t ebp;
|
||||
};
|
||||
union {
|
||||
uint16_t sp;
|
||||
uint32_t esp;
|
||||
};
|
||||
union {
|
||||
struct {
|
||||
uint8_t bl;
|
||||
uint8_t bh;
|
||||
} PACKED;
|
||||
uint16_t bx;
|
||||
uint32_t ebx;
|
||||
};
|
||||
union {
|
||||
struct {
|
||||
uint8_t dl;
|
||||
uint8_t dh;
|
||||
} PACKED;
|
||||
uint16_t dx;
|
||||
uint32_t edx;
|
||||
};
|
||||
union {
|
||||
struct {
|
||||
uint8_t cl;
|
||||
uint8_t ch;
|
||||
} PACKED;
|
||||
uint16_t cx;
|
||||
uint32_t ecx;
|
||||
};
|
||||
union {
|
||||
struct {
|
||||
uint8_t al;
|
||||
uint8_t ah;
|
||||
} PACKED;
|
||||
uint16_t ax;
|
||||
uint32_t eax;
|
||||
};
|
||||
} regs_t;
|
||||
|
||||
/* Struct to hold segment register values. Don't change the order;
|
||||
* many bits of assembly code rely on it.
|
||||
*/
|
||||
typedef struct {
|
||||
uint16_t cs;
|
||||
uint16_t ss;
|
||||
uint16_t ds;
|
||||
uint16_t es;
|
||||
uint16_t fs;
|
||||
uint16_t gs;
|
||||
} PACKED seg_regs_t;
|
||||
|
||||
/* Struct for a GDT descriptor */
|
||||
typedef struct {
|
||||
uint16_t limit;
|
||||
uint32_t address;
|
||||
uint16_t padding;
|
||||
} PACKED gdt_descriptor_t;
|
||||
|
||||
/* Struct for a GDT entry. Use GDT_SEGMENT() to fill it in.
|
||||
*/
|
||||
typedef struct {
|
||||
uint16_t limit_0_15;
|
||||
uint16_t base_0_15;
|
||||
uint8_t base_16_23;
|
||||
uint8_t accessed__type__sflag__dpl__present;
|
||||
uint8_t limit_16_19__avl__size__granularity;
|
||||
uint8_t base_24_31;
|
||||
} PACKED gdt_segment_t;
|
||||
|
||||
#define GDT_SEGMENT(base,limit,type,sflag,dpl,avl,size,granularity) \
|
||||
( (gdt_segment_t) { \
|
||||
( (limit) & 0xffff ), \
|
||||
( (base) & 0xffff ), \
|
||||
( ( (base) >> 16 ) & 0xff ), \
|
||||
( ( 1 << 0 ) | ( (type) << 1 ) | \
|
||||
( (sflag) << 4 ) | ( (dpl) << 5 ) | ( 1 << 7 ) ), \
|
||||
( ( (limit) >> 16 ) | \
|
||||
( (avl) << 4 ) | ( (size) << 5 ) | ( (granularity) << 7 ) ),\
|
||||
( (base) >> 24 ) \
|
||||
} )
|
||||
#define GDT_SEGMENT_BASE(gdt_segment) \
|
||||
( (gdt_segment)->base_0_15 | \
|
||||
(gdt_segment)->base_16_23 << 16 | \
|
||||
(gdt_segment)->base_24_31 << 24 )
|
||||
#define GDT_SEGMENT_LIMIT(gdt_segment) \
|
||||
( (gdt_segment)->limit_0_15 | \
|
||||
( ( (gdt_segment)->limit_16_19__avl__size__granularity \
|
||||
& 0xf ) << 16 ) )
|
||||
#define GDT_SEGMENT_GRANULARITY(gdt_segment) \
|
||||
( ( (gdt_segment)->limit_16_19__avl__size__granularity \
|
||||
& 0x80 ) >> 7 )
|
||||
#define GDT_SEGMENT_TYPE(gdt_segment) \
|
||||
( ( (gdt_segment)->accessed__type__sflag__dpl__present & 0x0e ) >> 1 )
|
||||
#define GDT_SEGMENT_SIZE(gdt_segment) \
|
||||
( ( (gdt_segment)->limit_16_19__avl__size__granularity \
|
||||
& 0x60 ) >> 5 )
|
||||
|
||||
#define GDT_TYPE_DATA (0x0)
|
||||
#define GDT_TYPE_STACK (0x2)
|
||||
#define GDT_TYPE_WRITEABLE (0x1)
|
||||
#define GDT_TYPE_CODE (0x6)
|
||||
#define GDT_TYPE_EXEC_ONLY_CODE (0x4)
|
||||
#define GDT_TYPE_CONFORMING (0x1)
|
||||
#define GDT_SFLAG_SYSTEM (0)
|
||||
#define GDT_SFLAG_NORMAL (1)
|
||||
#define GDT_AVL_NORMAL (0)
|
||||
#define GDT_SIZE_16BIT (0x0)
|
||||
#define GDT_SIZE_32BIT (0x2)
|
||||
#define GDT_SIZE_64BIT (0x1)
|
||||
#define GDT_SIZE_UNKNOWN (0x3)
|
||||
#define GDT_GRANULARITY_SMALL (0)
|
||||
#define GDT_GRANULARITY_LARGE (1)
|
||||
#define GDT_SEGMENT_NORMAL(base,limit,type,size,granularity) \
|
||||
GDT_SEGMENT ( base, limit, type, \
|
||||
GDT_SFLAG_NORMAL, 0, GDT_AVL_NORMAL, \
|
||||
size, granularity )
|
||||
|
||||
/* Protected mode code segment */
|
||||
#define GDT_SEGMENT_PMCS(base) GDT_SEGMENT_NORMAL ( \
|
||||
base, 0xfffff, GDT_TYPE_CODE | GDT_TYPE_CONFORMING, \
|
||||
GDT_SIZE_32BIT, GDT_GRANULARITY_LARGE )
|
||||
#define GDT_SEGMENT_PMCS_PHYS GDT_SEGMENT_PMCS(0)
|
||||
/* Protected mode data segment */
|
||||
#define GDT_SEGMENT_PMDS(base) GDT_SEGMENT_NORMAL ( \
|
||||
base, 0xfffff, GDT_TYPE_DATA | GDT_TYPE_WRITEABLE, \
|
||||
GDT_SIZE_32BIT, GDT_GRANULARITY_LARGE )
|
||||
#define GDT_SEGMENT_PMDS_PHYS GDT_SEGMENT_PMDS(0)
|
||||
/* Real mode code segment */
|
||||
/* Not sure if there's any reason to use GDT_TYPE_EXEC_ONLY_CODE
|
||||
* instead of just GDT_TYPE_CODE, but that's what our old GDT did and
|
||||
* it worked, so I'm not changing it.
|
||||
*/
|
||||
#define GDT_SEGMENT_RMCS(base) GDT_SEGMENT_NORMAL ( \
|
||||
base, 0xffff, GDT_TYPE_EXEC_ONLY_CODE | GDT_TYPE_CONFORMING, \
|
||||
GDT_SIZE_16BIT, GDT_GRANULARITY_SMALL )
|
||||
/* Real mode data segment */
|
||||
#define GDT_SEGMENT_RMDS(base) GDT_SEGMENT_NORMAL ( \
|
||||
base, 0xffff, GDT_TYPE_DATA | GDT_TYPE_WRITEABLE, \
|
||||
GDT_SIZE_16BIT, GDT_GRANULARITY_SMALL )
|
||||
/* Long mode code segment */
|
||||
#define GDT_SEGMENT_LMCS(base) GDT_SEGMENT_NORMAL ( \
|
||||
base, 0xfffff, GDT_TYPE_CODE | GDT_TYPE_CONFORMING, \
|
||||
GDT_SIZE_64BIT, GDT_GRANULARITY_LARGE )
|
||||
#define GDT_SEGMENT_LMCS_PHYS GDT_SEGMENT_LMCS(0)
|
||||
/* Long mode data segment */
|
||||
/* AFIACT, GDT_SIZE_64BIT applies only to code segments */
|
||||
#define GDT_SEGMENT_LMDS(base) GDT_SEGMENT_NORMAL ( \
|
||||
base, 0xfffff, GDT_TYPE_DATA | GDT_TYPE_WRITEABLE, \
|
||||
GDT_SIZE_32BIT, GDT_GRANULARITY_LARGE )
|
||||
#define GDT_SEGMENT_LMDS_PHYS GDT_SEGMENT_LMDS(0)
|
||||
|
||||
/* Template for creating GDT structures (including segment register
|
||||
* lists), suitable for passing as parameters to external_call().
|
||||
*/
|
||||
#define GDT_STRUCT_t(num_segments) \
|
||||
struct { \
|
||||
gdt_descriptor_t descriptor; \
|
||||
gdt_segment_t segments[num_segments]; \
|
||||
} PACKED
|
||||
/* And utility function for filling it in */
|
||||
#define GDT_ADJUST(structure) { \
|
||||
(structure)->descriptor.address = \
|
||||
virt_to_phys(&((structure)->descriptor.limit)); \
|
||||
(structure)->descriptor.limit = \
|
||||
sizeof((structure)->segments) + 8 - 1; \
|
||||
(structure)->descriptor.padding = 0; \
|
||||
}
|
||||
|
||||
/* Data passed in to in_call() by assembly wrapper.
|
||||
*/
|
||||
typedef struct {
|
||||
regs_t regs;
|
||||
seg_regs_t seg_regs;
|
||||
gdt_descriptor_t gdt_desc;
|
||||
uint32_t flags;
|
||||
struct {
|
||||
uint32_t offset;
|
||||
uint32_t segment;
|
||||
} ret_addr;
|
||||
} PACKED i386_pm_in_call_data_t;
|
||||
|
||||
typedef struct {
|
||||
seg_regs_t seg_regs;
|
||||
union {
|
||||
uint16_t pad;
|
||||
uint16_t prefix_sp;
|
||||
};
|
||||
uint16_t flags;
|
||||
struct {
|
||||
uint16_t offset;
|
||||
uint16_t segment;
|
||||
} ret_addr;
|
||||
uint32_t orig_opcode;
|
||||
} PACKED i386_rm_in_call_data_t;
|
||||
|
||||
typedef struct {
|
||||
i386_pm_in_call_data_t *pm;
|
||||
i386_rm_in_call_data_t *rm;
|
||||
} i386_in_call_data_t;
|
||||
#define in_call_data_t i386_in_call_data_t
|
||||
|
||||
/* Function prototypes
|
||||
*/
|
||||
extern int install_rm_callback_interface ( void *address, size_t available );
|
||||
|
||||
#endif /* ASSEMBLY */
|
||||
|
||||
#define RM_IN_CALL (0)
|
||||
#define RM_IN_CALL_FAR (2)
|
||||
|
||||
#endif /* CALLBACKS_ARCH_H */
|
||||
@@ -7,6 +7,8 @@
|
||||
* SYSLINUX COMBOOT
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <setjmp.h>
|
||||
#include <gpxe/in.h>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef _FAKEE820_H
|
||||
#define _FAKEE820_H
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
extern void fake_e820 ( void );
|
||||
extern void unfake_e820 ( void );
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <gpxe/acpi.h>
|
||||
#include <gpxe/if_ether.h>
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#ifdef NAP_PCBIOS
|
||||
#define NAP_PREFIX_pcbios
|
||||
#else
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#ifdef SMBIOS_PCBIOS
|
||||
#define SMBIOS_PREFIX_pcbios
|
||||
#else
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#ifdef TIMER_PCBIOS
|
||||
#define TIMER_PREFIX_pcbios
|
||||
#else
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( BSD2 );
|
||||
|
||||
/** @file
|
||||
*
|
||||
* iSCSI boot firmware table
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#ifdef UMALLOC_MEMTOP
|
||||
#define UMALLOC_PREFIX_memtop
|
||||
#else
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#ifdef TIMER_RDTSC
|
||||
#define TIMER_PREFIX_rdtsc
|
||||
#else
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
#ifndef _GPXE_SBFT_H
|
||||
#define _GPXE_SBFT_H
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009 Fen Systems Ltd <mbrown@fensystems.co.uk>.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( BSD2 );
|
||||
|
||||
/** @file
|
||||
*
|
||||
* SRP boot firmware table
|
||||
*
|
||||
* The working draft specification for the SRP boot firmware table can
|
||||
* be found at
|
||||
*
|
||||
* http://etherboot.org/wiki/srp/sbft
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <gpxe/acpi.h>
|
||||
#include <gpxe/scsi.h>
|
||||
#include <gpxe/srp.h>
|
||||
#include <gpxe/ib_srp.h>
|
||||
|
||||
/** SRP Boot Firmware Table signature */
|
||||
#define SBFT_SIG "sBFT"
|
||||
|
||||
/** An offset from the start of the sBFT */
|
||||
typedef uint16_t sbft_off_t;
|
||||
|
||||
/**
|
||||
* SRP Boot Firmware Table
|
||||
*/
|
||||
struct sbft_table {
|
||||
/** ACPI header */
|
||||
struct acpi_description_header acpi;
|
||||
/** Offset to SCSI subtable */
|
||||
sbft_off_t scsi_offset;
|
||||
/** Offset to SRP subtable */
|
||||
sbft_off_t srp_offset;
|
||||
/** Offset to IB subtable, if present */
|
||||
sbft_off_t ib_offset;
|
||||
/** Reserved */
|
||||
uint8_t reserved[6];
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/**
|
||||
* sBFT SCSI subtable
|
||||
*/
|
||||
struct sbft_scsi_subtable {
|
||||
/** LUN */
|
||||
struct scsi_lun lun;
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/**
|
||||
* sBFT SRP subtable
|
||||
*/
|
||||
struct sbft_srp_subtable {
|
||||
/** Initiator and target ports */
|
||||
struct srp_port_ids port_ids;
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/**
|
||||
* sBFT IB subtable
|
||||
*/
|
||||
struct sbft_ib_subtable {
|
||||
/** Source GID */
|
||||
struct ib_gid sgid;
|
||||
/** Destination GID */
|
||||
struct ib_gid dgid;
|
||||
/** Service ID */
|
||||
struct ib_gid_half service_id;
|
||||
/** Partition key */
|
||||
uint16_t pkey;
|
||||
/** Reserved */
|
||||
uint8_t reserved[6];
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/**
|
||||
* An sBFT created by gPXE
|
||||
*/
|
||||
struct gpxe_sbft {
|
||||
/** The table header */
|
||||
struct sbft_table table;
|
||||
/** The SCSI subtable */
|
||||
struct sbft_scsi_subtable scsi;
|
||||
/** The SRP subtable */
|
||||
struct sbft_srp_subtable srp;
|
||||
/** The IB subtable */
|
||||
struct sbft_ib_subtable ib;
|
||||
} __attribute__ (( packed, aligned ( 16 ) ));
|
||||
|
||||
struct srp_device;
|
||||
|
||||
extern int sbft_fill_data ( struct srp_device *srp );
|
||||
|
||||
#endif /* _GPXE_SBFT_H */
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
extern void timer2_udelay ( unsigned long usecs );
|
||||
|
||||
#endif /* _GPXE_TIMER2_H */
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
* into a machine with such an old CPU anyway.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#ifdef IOAPI_X86
|
||||
#define IOAPI_PREFIX_x86
|
||||
#else
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <gpxe/list.h>
|
||||
#include <realmode.h>
|
||||
|
||||
Executable → Regular
+2
@@ -1,6 +1,8 @@
|
||||
#ifndef LIBRM_H
|
||||
#define LIBRM_H
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/* Segment selectors as used in our protected-mode GDTs.
|
||||
*
|
||||
* Don't change these unless you really know what you're doing.
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef LIMITS_H
|
||||
#define LIMITS_H 1
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/* Number of bits in a `char' */
|
||||
#define CHAR_BIT 8
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef _MEMSIZES_H
|
||||
#define _MEMSIZES_H
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <basemem.h>
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/** The magic number for the Multiboot header */
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
* Initially written by Michael Brown (mcb30).
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#ifndef PIC8259_H
|
||||
#define PIC8259_H
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/* BIOS segment address */
|
||||
#define BIOS_SEG 0xf000
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef PXE_H
|
||||
#define PXE_H
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include "pxe_types.h"
|
||||
#include "pxe_api.h"
|
||||
#include <gpxe/device.h>
|
||||
|
||||
@@ -15,6 +15,31 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
* As an alternative, at your option, you may use this file under the
|
||||
* following terms, known as the "MIT license":
|
||||
*
|
||||
* Copyright (c) 2005-2009 Michael Brown <mbrown@fensystems.co.uk>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use, copy,
|
||||
* modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
* of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/** @file
|
||||
@@ -23,6 +48,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include "pxe_types.h"
|
||||
|
||||
/** @addtogroup pxe Preboot eXecution Environment (PXE) API
|
||||
@@ -1415,6 +1442,25 @@ extern PXENV_EXIT_t pxenv_undi_get_nic_type (
|
||||
/** PXE API function code for pxenv_undi_get_iface_info() */
|
||||
#define PXENV_UNDI_GET_IFACE_INFO 0x0013
|
||||
|
||||
/** Broadcast supported */
|
||||
#define SUPPORTED_BROADCAST 0x0001
|
||||
/** Multicast supported */
|
||||
#define SUPPORTED_MULTICAST 0x0002
|
||||
/** Functional/group addressing supported */
|
||||
#define SUPPORTED_GROUP 0x0004
|
||||
/** Promiscuous mode supported */
|
||||
#define SUPPORTED_PROMISCUOUS 0x0008
|
||||
/** Software settable station address */
|
||||
#define SUPPORTED_SET_STATION_ADDRESS 0x0010
|
||||
/** InitiateDiagnostics supported */
|
||||
#define SUPPORTED_DIAGNOSTICS 0x0040
|
||||
/** Reset MAC supported */
|
||||
#define SUPPORTED_RESET 0x0400
|
||||
/** Open / Close Adapter supported */
|
||||
#define SUPPORTED_OPEN_CLOSE 0x0800
|
||||
/** Interrupt Request supported */
|
||||
#define SUPPORTED_IRQ 0x1000
|
||||
|
||||
/** Parameter block for pxenv_undi_get_iface_info() */
|
||||
struct s_PXENV_UNDI_GET_IFACE_INFO {
|
||||
PXENV_STATUS_t Status; /**< PXE status code */
|
||||
|
||||
@@ -6,9 +6,13 @@
|
||||
* PXE API entry point
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <pxe_api.h>
|
||||
#include <realmode.h>
|
||||
|
||||
struct net_device;
|
||||
|
||||
/** PXE load address segment */
|
||||
#define PXE_LOAD_SEGMENT 0
|
||||
|
||||
@@ -26,9 +30,8 @@ extern struct s_PXE __text16 ( ppxe );
|
||||
extern struct s_PXENV __text16 ( pxenv );
|
||||
#define pxenv __use_text16 ( pxenv )
|
||||
|
||||
extern void pxe_hook_int1a ( void );
|
||||
extern int pxe_unhook_int1a ( void );
|
||||
extern void pxe_init_structures ( void );
|
||||
extern void pxe_activate ( struct net_device *netdev );
|
||||
extern int pxe_deactivate ( void );
|
||||
extern int pxe_start_nbp ( void );
|
||||
extern __asmcall void pxe_api_call ( struct i386_all_regs *ix86 );
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <errno.h> /* PXE status codes */
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/*
|
||||
* Declaration of variables in .data16
|
||||
*
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef ETHERBOOT_SETJMP_H
|
||||
#define ETHERBOOT_SETJMP_H
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <realmode.h>
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#ifndef ASSEMBLY
|
||||
|
||||
#include <gpxe/device.h>
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
struct undi_device;
|
||||
struct undi_rom;
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
struct undi_device;
|
||||
|
||||
extern int undinet_probe ( struct undi_device *undi );
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <realmode.h>
|
||||
#include <undi.h>
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <pxe_types.h>
|
||||
|
||||
/** An UNDI PCI device ID */
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <realmode.h>
|
||||
#include <gpxe/aoe.h>
|
||||
#include <gpxe/netdevice.h>
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
#include <gpxe/abft.h>
|
||||
#include <int13.h>
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
static int aoeboot ( const char *root_path ) {
|
||||
struct ata_device ata;
|
||||
struct int13_drive drive;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include <gpxe/nap.h>
|
||||
#include <realmode.h>
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/**
|
||||
* Save power by halting the CPU until the next interrupt
|
||||
*
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER );
|
||||
|
||||
/** @file
|
||||
*
|
||||
* BIOS timer
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user