1f5ab4280a
* kern/i386/pc/lzo1x.S: New file. * util/i386/pc/pupa-mkimage.c: Include lzo1x.h. (compress_kernel): New variable. (generate_image): Heavily modified to support compressing a large part of the core image. * util/misc.c (pupa_util_read_image): Fix a file descriptor leak. (pupa_util_load_image): New function. * kern/i386/pc/startup.S: Include pupa/machine/kernel.h. (pupa_compressed_size): New variable. (codestart): Enable Gate A20 here. Decompress the compressed part of the core image. Rearrange the code to put functions and variables which are required for initialization in the non-compressed part. Include lzo1x.S. * kern/i386/pc/init.c (pupa_machine_init): Don't enable Gate A20 here. * include/pupa/util/misc.h (pupa_util_write_image): Declared. * include/pupa/i386/pc/kernel.h (PUPA_KERNEL_MACHINE_COMPRESSED_SIZE): New macro. (PUPA_KERNEL_MACHINE_INSTALL_DOS_PART): Increased by 4. (PUPA_KERNEL_MACHINE_INSTALL_BSD_PART): Likewise. (PUPA_KERNEL_MACHINE_PREFIX): Likewise. (PUPA_KERNEL_MACHINE_RAW_SIZE): New macro. * conf/i386-pc.rmk (pupa_mkimage_LDFLAGS): New variable. * genmk.rb (Image#rule): Put LDFLAGS at the end of a line. (Utility#rule): Likewise. * configure.ac: Check if LZO is available.
82 lines
2.5 KiB
Makefile
82 lines
2.5 KiB
Makefile
# -*- makefile -*-
|
|
|
|
COMMON_ASFLAGS = -nostdinc -fno-builtin
|
|
COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3
|
|
|
|
# Images.
|
|
pkgdata_IMAGES = boot.img diskboot.img kernel.img
|
|
|
|
# For boot.img.
|
|
boot_img_SOURCES = boot/i386/pc/boot.S
|
|
boot_img_ASFLAGS = $(COMMON_ASFLAGS)
|
|
boot_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
|
|
|
|
# For diskboot.img.
|
|
diskboot_img_SOURCES = boot/i386/pc/diskboot.S
|
|
diskboot_img_ASFLAGS = $(COMMON_ASFLAGS)
|
|
diskboot_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,8000
|
|
|
|
# For kernel.img.
|
|
kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \
|
|
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
|
|
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
|
|
kern/i386/dl.c kern/i386/pc/init.c disk/i386/pc/partition.c \
|
|
disk/i386/pc/biosdisk.c \
|
|
term/i386/pc/console.c \
|
|
symlist.c
|
|
kernel_img_HEADERS = boot.h device.h disk.h dl.h elf.h err.h \
|
|
file.h fs.h kernel.h loader.h misc.h mm.h net.h rescue.h symbol.h \
|
|
term.h types.h machine/biosdisk.h machine/boot.h \
|
|
machine/console.h machine/init.h machine/memory.h \
|
|
machine/loader.h machine/partition.h
|
|
kernel_img_CFLAGS = $(COMMON_CFLAGS)
|
|
kernel_img_ASFLAGS = $(COMMON_ASFLAGS)
|
|
kernel_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,8200
|
|
|
|
MOSTLYCLEANFILES += symlist.c kernel_syms.lst
|
|
DEFSYMFILES += kernel_syms.lst
|
|
|
|
symlist.c: $(addprefix include/pupa/,$(kernel_img_HEADERS)) gensymlist.sh
|
|
sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@
|
|
|
|
kernel_syms.lst: $(addprefix include/pupa/,$(kernel_img_HEADERS)) genkernsyms.sh
|
|
sh $(srcdir)/genkernsyms.sh $(filter %h,$^) > $@
|
|
|
|
# Utilities.
|
|
bin_UTILITIES = pupa-mkimage
|
|
sbin_UTILITIES = pupa-setup
|
|
noinst_UTILITIES = genmoddep
|
|
|
|
# For pupa-mkimage.
|
|
pupa_mkimage_SOURCES = util/i386/pc/pupa-mkimage.c util/misc.c \
|
|
util/resolve.c
|
|
pupa_mkimage_LDFLAGS = -llzo
|
|
|
|
# For pupa-setup.
|
|
pupa_setup_SOURCES = util/i386/pc/pupa-setup.c util/i386/pc/biosdisk.c \
|
|
util/misc.c kern/device.c kern/disk.c kern/file.c kern/fs.c \
|
|
kern/err.c kern/misc.c disk/i386/pc/partition.c fs/fat.c
|
|
|
|
# For genmoddep.
|
|
genmoddep_SOURCES = util/genmoddep.c
|
|
|
|
# Modules.
|
|
pkgdata_MODULES = _chain.mod _linux.mod fat.mod normal.mod
|
|
|
|
# For _chain.mod.
|
|
_chain_mod_SOURCES = loader/i386/pc/chainloader.c
|
|
_chain_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For fat.mod.
|
|
fat_mod_SOURCES = fs/fat.c
|
|
fat_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For _linux.mod.
|
|
_linux_mod_SOURCES = loader/i386/pc/linux.c
|
|
_linux_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
|
|
# For normal.mod.
|
|
normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/main.c \
|
|
normal/menu.c normal/i386/setjmp.S
|
|
normal_mod_CFLAGS = $(COMMON_CFLAGS)
|
|
normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
|