grub/conf/i386-pc.mk

797 lines
36 KiB
Makefile
Raw Normal View History

2002-12-27 08:53:07 +00:00
# -*- makefile -*-
COMMON_ASFLAGS = -nostdinc -fno-builtin
COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3
2002-12-27 08:53:07 +00:00
# Images.
pkgdata_IMAGES = boot.img diskboot.img kernel.img
# For boot.img.
boot_img_SOURCES = boot/i386/pc/boot.S
CLEANFILES += boot.img boot.exec boot_img-boot_i386_pc_boot.o
MOSTLYCLEANFILES += boot_img-boot_i386_pc_boot.d
boot.img: boot.exec
$(OBJCOPY) -O binary -R .note -R .comment $< $@
boot.exec: boot_img-boot_i386_pc_boot.o
$(CC) -o $@ $^ $(LDFLAGS) $(boot_img_LDFLAGS)
2002-12-27 08:53:07 +00:00
boot_img-boot_i386_pc_boot.o: boot/i386/pc/boot.S
$(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(boot_img_ASFLAGS) -c -o $@ $<
boot_img-boot_i386_pc_boot.d: boot/i386/pc/boot.S
set -e; $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(boot_img_ASFLAGS) -M $< | sed 's,boot\.o[ :]*,boot_img-boot_i386_pc_boot.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include boot_img-boot_i386_pc_boot.d
boot_img_ASFLAGS = $(COMMON_ASFLAGS)
boot_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,7C00
# For diskboot.img.
diskboot_img_SOURCES = boot/i386/pc/diskboot.S
CLEANFILES += diskboot.img diskboot.exec diskboot_img-boot_i386_pc_diskboot.o
MOSTLYCLEANFILES += diskboot_img-boot_i386_pc_diskboot.d
diskboot.img: diskboot.exec
$(OBJCOPY) -O binary -R .note -R .comment $< $@
diskboot.exec: diskboot_img-boot_i386_pc_diskboot.o
$(CC) -o $@ $^ $(LDFLAGS) $(diskboot_img_LDFLAGS)
2002-12-27 08:53:07 +00:00
diskboot_img-boot_i386_pc_diskboot.o: boot/i386/pc/diskboot.S
$(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(diskboot_img_ASFLAGS) -c -o $@ $<
diskboot_img-boot_i386_pc_diskboot.d: boot/i386/pc/diskboot.S
set -e; $(CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(diskboot_img_ASFLAGS) -M $< | sed 's,diskboot\.o[ :]*,diskboot_img-boot_i386_pc_diskboot.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include diskboot_img-boot_i386_pc_diskboot.d
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
CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-disk_i386_pc_partition.o kernel_img-disk_i386_pc_biosdisk.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o
MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-disk_i386_pc_partition.d kernel_img-disk_i386_pc_biosdisk.d kernel_img-term_i386_pc_console.d kernel_img-symlist.d
kernel.img: kernel.exec
$(OBJCOPY) -O binary -R .note -R .comment $< $@
kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-disk_i386_pc_partition.o kernel_img-disk_i386_pc_biosdisk.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o
$(CC) -o $@ $^ $(LDFLAGS) $(kernel_img_LDFLAGS)
2002-12-27 08:53:07 +00:00
kernel_img-kern_i386_pc_startup.o: kern/i386/pc/startup.S
$(CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(kernel_img_ASFLAGS) -c -o $@ $<
kernel_img-kern_i386_pc_startup.d: kern/i386/pc/startup.S
set -e; $(CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(CPPFLAGS) -DASM_FILE=1 $(ASFLAGS) $(kernel_img_ASFLAGS) -M $< | sed 's,startup\.o[ :]*,kernel_img-kern_i386_pc_startup.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_i386_pc_startup.d
kernel_img-kern_main.o: kern/main.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-kern_main.d: kern/main.c
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,main\.o[ :]*,kernel_img-kern_main.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_main.d
kernel_img-kern_device.o: kern/device.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-kern_device.d: kern/device.c
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,device\.o[ :]*,kernel_img-kern_device.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_device.d
kernel_img-kern_disk.o: kern/disk.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-kern_disk.d: kern/disk.c
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,disk\.o[ :]*,kernel_img-kern_disk.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_disk.d
kernel_img-kern_dl.o: kern/dl.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-kern_dl.d: kern/dl.c
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,dl\.o[ :]*,kernel_img-kern_dl.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_dl.d
kernel_img-kern_file.o: kern/file.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-kern_file.d: kern/file.c
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,file\.o[ :]*,kernel_img-kern_file.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_file.d
kernel_img-kern_fs.o: kern/fs.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-kern_fs.d: kern/fs.c
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,fs\.o[ :]*,kernel_img-kern_fs.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_fs.d
kernel_img-kern_err.o: kern/err.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-kern_err.d: kern/err.c
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,err\.o[ :]*,kernel_img-kern_err.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_err.d
kernel_img-kern_misc.o: kern/misc.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-kern_misc.d: kern/misc.c
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,misc\.o[ :]*,kernel_img-kern_misc.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_misc.d
kernel_img-kern_mm.o: kern/mm.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-kern_mm.d: kern/mm.c
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,mm\.o[ :]*,kernel_img-kern_mm.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_mm.d
kernel_img-kern_loader.o: kern/loader.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-kern_loader.d: kern/loader.c
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,loader\.o[ :]*,kernel_img-kern_loader.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_loader.d
kernel_img-kern_rescue.o: kern/rescue.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-kern_rescue.d: kern/rescue.c
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,rescue\.o[ :]*,kernel_img-kern_rescue.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_rescue.d
kernel_img-kern_term.o: kern/term.c
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-kern_term.d: kern/term.c
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,term\.o[ :]*,kernel_img-kern_term.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_term.d
kernel_img-kern_i386_dl.o: kern/i386/dl.c
$(CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-kern_i386_dl.d: kern/i386/dl.c
set -e; $(CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,dl\.o[ :]*,kernel_img-kern_i386_dl.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_i386_dl.d
kernel_img-kern_i386_pc_init.o: kern/i386/pc/init.c
$(CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-kern_i386_pc_init.d: kern/i386/pc/init.c
set -e; $(CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,init\.o[ :]*,kernel_img-kern_i386_pc_init.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-kern_i386_pc_init.d
kernel_img-disk_i386_pc_partition.o: disk/i386/pc/partition.c
$(CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-disk_i386_pc_partition.d: disk/i386/pc/partition.c
set -e; $(CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,partition\.o[ :]*,kernel_img-disk_i386_pc_partition.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-disk_i386_pc_partition.d
kernel_img-disk_i386_pc_biosdisk.o: disk/i386/pc/biosdisk.c
$(CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-disk_i386_pc_biosdisk.d: disk/i386/pc/biosdisk.c
set -e; $(CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,biosdisk\.o[ :]*,kernel_img-disk_i386_pc_biosdisk.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-disk_i386_pc_biosdisk.d
kernel_img-term_i386_pc_console.o: term/i386/pc/console.c
$(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-term_i386_pc_console.d: term/i386/pc/console.c
set -e; $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,console\.o[ :]*,kernel_img-term_i386_pc_console.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-term_i386_pc_console.d
kernel_img-symlist.o: symlist.c
$(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -c -o $@ $<
kernel_img-symlist.d: symlist.c
set -e; $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) $(kernel_img_CFLAGS) -M $< | sed 's,symlist\.o[ :]*,kernel_img-symlist.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include kernel_img-symlist.d
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 \
2003-09-25 Yoshinori K. Okuji <okuji@enbug.org> I forgot to check in these changes for a long time. This adds incomplete support for VGA console, and this is still very buggy. Also, a lot of consideration is required for I18N, UNICODE, and VGA font issues. Therefore, assume that this is such that "better than nothing". * font/manager.c: New file. * include/pupa/font.h: Likewise. * include/pupa/i386/pc/vga.h: Likewise. * term/i386/pc/vga.c: Likewise. * util/unifont2pff.rb: Likewise. * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/vga.h. (pkgdata_MODULES): Added vga.mod and font.mod. (vga_mod_SOURCES): New variables. (vga_mod_CFLAGS): Likewise. (font_mod_SOURCES): Likewise. (font_mod_CFLAGS): Likewise. * include/pupa/err.h (PUPA_ERR_BAD_FONT): New constant. * include/pupa/term.h: Include pupa/err.h. (struct pupa_term): Added init and fini. Changed the argument of putchar to pupa_uint32_t. * include/pupa/i386/pc/console.h: Include pupa/symbol.h. (pupa_console_real_putchar): New prototype. (pupa_console_putchar): Removed. (pupa_console_checkkey): Exported. (pupa_console_getkey): Likewise. * kern/misc.c (pupa_vsprintf): Add support for UNICODE characters. * kern/term.c (pupa_term_set_current): Rewritten. (pupa_putchar): Likewise. (pupa_putcode): New function. * kern/i386/pc/startup.S (pupa_console_putchar): Renamed to ... (pupa_console_real_putchar): ... this. (pupa_vga_set_mode): New function. (pupa_vga_get_font): Likewise. * normal/command.c: Include pupa/term.h. (terminal_command): New function. (pupa_command_init): Register the command "terminal". * normal/menu.c (DISP_LEFT): Changed to a UNICODE value. (DISP_UP): Likewise. (DISP_RIGHT): Likewise. (DISP_DOWN): Likewise. (DISP_HLINE): Likewise. (DISP_VLINE): Likewise. (DISP_UL): Likewise. (DISP_UR): Likewise. (DISP_LL): Likewise. (DISP_LR): Likewise. * term/i386/pc/console.c (pupa_console_putchar): New function.
2003-09-25 20:15:53 +00:00
machine/loader.h machine/partition.h machine/vga.h
2002-12-27 08:53:07 +00:00
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
2002-12-27 08:53:07 +00:00
noinst_UTILITIES = genmoddep
# For pupa-mkimage.
pupa_mkimage_SOURCES = util/i386/pc/pupa-mkimage.c util/misc.c \
util/resolve.c
CLEANFILES += pupa-mkimage pupa_mkimage-util_i386_pc_pupa_mkimage.o pupa_mkimage-util_misc.o pupa_mkimage-util_resolve.o
MOSTLYCLEANFILES += pupa_mkimage-util_i386_pc_pupa_mkimage.d pupa_mkimage-util_misc.d pupa_mkimage-util_resolve.d
pupa-mkimage: pupa_mkimage-util_i386_pc_pupa_mkimage.o pupa_mkimage-util_misc.o pupa_mkimage-util_resolve.o
$(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(pupa_mkimage_LDFLAGS)
2002-12-27 08:53:07 +00:00
pupa_mkimage-util_i386_pc_pupa_mkimage.o: util/i386/pc/pupa-mkimage.c
$(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_mkimage_CFLAGS) -c -o $@ $<
2002-12-27 08:53:07 +00:00
pupa_mkimage-util_i386_pc_pupa_mkimage.d: util/i386/pc/pupa-mkimage.c
set -e; $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_mkimage_CFLAGS) -M $< | sed 's,pupa\-mkimage\.o[ :]*,pupa_mkimage-util_i386_pc_pupa_mkimage.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
2002-12-27 08:53:07 +00:00
-include pupa_mkimage-util_i386_pc_pupa_mkimage.d
pupa_mkimage-util_misc.o: util/misc.c
$(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_mkimage_CFLAGS) -c -o $@ $<
2002-12-27 08:53:07 +00:00
pupa_mkimage-util_misc.d: util/misc.c
set -e; $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_mkimage_CFLAGS) -M $< | sed 's,misc\.o[ :]*,pupa_mkimage-util_misc.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
2002-12-27 08:53:07 +00:00
-include pupa_mkimage-util_misc.d
pupa_mkimage-util_resolve.o: util/resolve.c
$(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_mkimage_CFLAGS) -c -o $@ $<
2002-12-27 08:53:07 +00:00
pupa_mkimage-util_resolve.d: util/resolve.c
set -e; $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_mkimage_CFLAGS) -M $< | sed 's,resolve\.o[ :]*,pupa_mkimage-util_resolve.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
2002-12-27 08:53:07 +00:00
-include pupa_mkimage-util_resolve.d
pupa_mkimage_LDFLAGS = -llzo
2002-12-27 08:53:07 +00:00
# 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 fs/ext2.c
CLEANFILES += pupa-setup pupa_setup-util_i386_pc_pupa_setup.o pupa_setup-util_i386_pc_biosdisk.o pupa_setup-util_misc.o pupa_setup-kern_device.o pupa_setup-kern_disk.o pupa_setup-kern_file.o pupa_setup-kern_fs.o pupa_setup-kern_err.o pupa_setup-kern_misc.o pupa_setup-disk_i386_pc_partition.o pupa_setup-fs_fat.o pupa_setup-fs_ext2.o
MOSTLYCLEANFILES += pupa_setup-util_i386_pc_pupa_setup.d pupa_setup-util_i386_pc_biosdisk.d pupa_setup-util_misc.d pupa_setup-kern_device.d pupa_setup-kern_disk.d pupa_setup-kern_file.d pupa_setup-kern_fs.d pupa_setup-kern_err.d pupa_setup-kern_misc.d pupa_setup-disk_i386_pc_partition.d pupa_setup-fs_fat.d pupa_setup-fs_ext2.d
pupa-setup: pupa_setup-util_i386_pc_pupa_setup.o pupa_setup-util_i386_pc_biosdisk.o pupa_setup-util_misc.o pupa_setup-kern_device.o pupa_setup-kern_disk.o pupa_setup-kern_file.o pupa_setup-kern_fs.o pupa_setup-kern_err.o pupa_setup-kern_misc.o pupa_setup-disk_i386_pc_partition.o pupa_setup-fs_fat.o pupa_setup-fs_ext2.o
$(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(pupa_setup_LDFLAGS)
pupa_setup-util_i386_pc_pupa_setup.o: util/i386/pc/pupa-setup.c
$(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -c -o $@ $<
pupa_setup-util_i386_pc_pupa_setup.d: util/i386/pc/pupa-setup.c
set -e; $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -M $< | sed 's,pupa\-setup\.o[ :]*,pupa_setup-util_i386_pc_pupa_setup.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include pupa_setup-util_i386_pc_pupa_setup.d
pupa_setup-util_i386_pc_biosdisk.o: util/i386/pc/biosdisk.c
$(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -c -o $@ $<
pupa_setup-util_i386_pc_biosdisk.d: util/i386/pc/biosdisk.c
set -e; $(BUILD_CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -M $< | sed 's,biosdisk\.o[ :]*,pupa_setup-util_i386_pc_biosdisk.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include pupa_setup-util_i386_pc_biosdisk.d
pupa_setup-util_misc.o: util/misc.c
$(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -c -o $@ $<
pupa_setup-util_misc.d: util/misc.c
set -e; $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -M $< | sed 's,misc\.o[ :]*,pupa_setup-util_misc.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include pupa_setup-util_misc.d
pupa_setup-kern_device.o: kern/device.c
$(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -c -o $@ $<
pupa_setup-kern_device.d: kern/device.c
set -e; $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -M $< | sed 's,device\.o[ :]*,pupa_setup-kern_device.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include pupa_setup-kern_device.d
pupa_setup-kern_disk.o: kern/disk.c
$(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -c -o $@ $<
pupa_setup-kern_disk.d: kern/disk.c
set -e; $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -M $< | sed 's,disk\.o[ :]*,pupa_setup-kern_disk.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include pupa_setup-kern_disk.d
pupa_setup-kern_file.o: kern/file.c
$(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -c -o $@ $<
pupa_setup-kern_file.d: kern/file.c
set -e; $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -M $< | sed 's,file\.o[ :]*,pupa_setup-kern_file.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include pupa_setup-kern_file.d
pupa_setup-kern_fs.o: kern/fs.c
$(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -c -o $@ $<
pupa_setup-kern_fs.d: kern/fs.c
set -e; $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -M $< | sed 's,fs\.o[ :]*,pupa_setup-kern_fs.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include pupa_setup-kern_fs.d
pupa_setup-kern_err.o: kern/err.c
$(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -c -o $@ $<
pupa_setup-kern_err.d: kern/err.c
set -e; $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -M $< | sed 's,err\.o[ :]*,pupa_setup-kern_err.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include pupa_setup-kern_err.d
pupa_setup-kern_misc.o: kern/misc.c
$(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -c -o $@ $<
pupa_setup-kern_misc.d: kern/misc.c
set -e; $(BUILD_CC) -Ikern -I$(srcdir)/kern $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -M $< | sed 's,misc\.o[ :]*,pupa_setup-kern_misc.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include pupa_setup-kern_misc.d
pupa_setup-disk_i386_pc_partition.o: disk/i386/pc/partition.c
$(BUILD_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -c -o $@ $<
pupa_setup-disk_i386_pc_partition.d: disk/i386/pc/partition.c
set -e; $(BUILD_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -M $< | sed 's,partition\.o[ :]*,pupa_setup-disk_i386_pc_partition.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include pupa_setup-disk_i386_pc_partition.d
pupa_setup-fs_fat.o: fs/fat.c
$(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -c -o $@ $<
pupa_setup-fs_fat.d: fs/fat.c
set -e; $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -M $< | sed 's,fat\.o[ :]*,pupa_setup-fs_fat.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include pupa_setup-fs_fat.d
pupa_setup-fs_ext2.o: fs/ext2.c
$(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -c -o $@ $<
pupa_setup-fs_ext2.d: fs/ext2.c
set -e; $(BUILD_CC) -Ifs -I$(srcdir)/fs $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(pupa_setup_CFLAGS) -M $< | sed 's,ext2\.o[ :]*,pupa_setup-fs_ext2.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include pupa_setup-fs_ext2.d
2002-12-27 08:53:07 +00:00
# For genmoddep.
genmoddep_SOURCES = util/genmoddep.c
CLEANFILES += genmoddep genmoddep-util_genmoddep.o
MOSTLYCLEANFILES += genmoddep-util_genmoddep.d
genmoddep: genmoddep-util_genmoddep.o
$(BUILD_CC) -o $@ $^ $(BUILD_LDFLAGS) $(genmoddep_LDFLAGS)
2002-12-27 08:53:07 +00:00
genmoddep-util_genmoddep.o: util/genmoddep.c
$(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(genmoddep_CFLAGS) -c -o $@ $<
2002-12-27 08:53:07 +00:00
genmoddep-util_genmoddep.d: util/genmoddep.c
set -e; $(BUILD_CC) -Iutil -I$(srcdir)/util $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -DPUPA_UTIL=1 $(genmoddep_CFLAGS) -M $< | sed 's,genmoddep\.o[ :]*,genmoddep-util_genmoddep.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
2002-12-27 08:53:07 +00:00
-include genmoddep-util_genmoddep.d
# Modules.
pkgdata_MODULES = _chain.mod _linux.mod fat.mod ext2.mod normal.mod hello.mod \
vga.mod font.mod _multiboot.mod
2002-12-27 08:53:07 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
# For _chain.mod.
_chain_mod_SOURCES = loader/i386/pc/chainloader.c
CLEANFILES += _chain.mod mod-_chain.o mod-_chain.c pre-_chain.o _chain_mod-loader_i386_pc_chainloader.o def-_chain.lst und-_chain.lst
MOSTLYCLEANFILES += _chain_mod-loader_i386_pc_chainloader.d
DEFSYMFILES += def-_chain.lst
UNDSYMFILES += und-_chain.lst
2002-12-27 08:53:07 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
_chain.mod: pre-_chain.o mod-_chain.o
2002-12-27 08:53:07 +00:00
-rm -f $@
$(LD) -r -o $@ $^
$(STRIP) --strip-unneeded -K pupa_mod_init -K pupa_mod_fini -R .note -R .comment $@
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
pre-_chain.o: _chain_mod-loader_i386_pc_chainloader.o
2002-12-27 08:53:07 +00:00
-rm -f $@
$(LD) -r -o $@ $^
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
mod-_chain.o: mod-_chain.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $<
2002-12-27 08:53:07 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
mod-_chain.c: moddep.lst genmodsrc.sh
sh $(srcdir)/genmodsrc.sh '_chain' $< > $@ || (rm -f $@; exit 1)
2002-12-27 08:53:07 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
def-_chain.lst: pre-_chain.o
$(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _chain/' > $@
2002-12-27 08:53:07 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
und-_chain.lst: pre-_chain.o
echo '_chain' > $@
$(NM) -u -P -p $< | cut -f1 -d' ' >> $@
2002-12-27 08:53:07 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
_chain_mod-loader_i386_pc_chainloader.o: loader/i386/pc/chainloader.c
$(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $<
2002-12-27 08:53:07 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
_chain_mod-loader_i386_pc_chainloader.d: loader/i386/pc/chainloader.c
set -e; $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_chain_mod_CFLAGS) -M $< | sed 's,chainloader\.o[ :]*,_chain_mod-loader_i386_pc_chainloader.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
2002-12-27 08:53:07 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
-include _chain_mod-loader_i386_pc_chainloader.d
2002-12-27 08:53:07 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
_chain_mod_CFLAGS = $(COMMON_CFLAGS)
2002-12-27 08:53:07 +00:00
# For fat.mod.
fat_mod_SOURCES = fs/fat.c
CLEANFILES += fat.mod mod-fat.o mod-fat.c pre-fat.o fat_mod-fs_fat.o def-fat.lst und-fat.lst
MOSTLYCLEANFILES += fat_mod-fs_fat.d
DEFSYMFILES += def-fat.lst
UNDSYMFILES += und-fat.lst
fat.mod: pre-fat.o mod-fat.o
-rm -f $@
$(LD) -r -o $@ $^
$(STRIP) --strip-unneeded -K pupa_mod_init -K pupa_mod_fini -R .note -R .comment $@
pre-fat.o: fat_mod-fs_fat.o
-rm -f $@
$(LD) -r -o $@ $^
mod-fat.o: mod-fat.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
2002-12-27 08:53:07 +00:00
mod-fat.c: moddep.lst genmodsrc.sh
sh $(srcdir)/genmodsrc.sh 'fat' $< > $@ || (rm -f $@; exit 1)
def-fat.lst: pre-fat.o
$(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fat/' > $@
und-fat.lst: pre-fat.o
echo 'fat' > $@
$(NM) -u -P -p $< | cut -f1 -d' ' >> $@
2002-12-27 08:53:07 +00:00
fat_mod-fs_fat.o: fs/fat.c
$(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $<
fat_mod-fs_fat.d: fs/fat.c
set -e; $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(fat_mod_CFLAGS) -M $< | sed 's,fat\.o[ :]*,fat_mod-fs_fat.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include fat_mod-fs_fat.d
fat_mod_CFLAGS = $(COMMON_CFLAGS)
2003-01-17 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/i386/pc/linux.h: New file. * loader/i386/pc/linux.c: Likewise. * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector): Removed. (pupa_chainloader_unload): Return PUPA_ERR_NONE. (pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead of PUPA_CHAINLOADER_BOOT_SECTOR. * kern/i386/pc/startup.S: Include pupa/machine/linux.h. (pupa_linux_prot_size): New variable. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): New function. (pupa_linux_boot_bzimage): Likewise. * kern/i386/pc/init.c (struct mem_region): New structure. (MAX_REGIONS): New macro. (mem_regions): New variable. (num_regions): Likewise. (pupa_os_area_addr): Likewise. (pupa_os_area_size): Likewise. (pupa_lower_mem): Likewise. (pupa_upper_mem): Likewise. (add_mem_region): New function. (compact_mem_regions): Likewise. (pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to the size of the conventional memory and that of so-called upper memory (before the first memory hole). Instead of adding each found region to free memory, use add_mem_region and add them after removing overlaps. Also, add only 1/4 of the upper memory to free memory. The rest is used for loading OS images. Maybe this is ad hoc, but this makes it much easier to relocate OS images when booting. * kern/rescue.c (pupa_rescue_cmd_module): Removed. (pupa_enter_rescue_mode): Don't register initrd and module. * kern/mm.c: Include pupa/dl.h. * kern/main.c: Include pupa/file.h and pupa/device.h. * kern/loader.c (pupa_loader_load_module_func): Removed. (pupa_loader_load_module): Likewise. * kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of ``.o''. * include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): Likewise. (pupa_linux_boot_bzimage): Likewise. * include/pupa/i386/pc/init.h (pupa_lower_mem): Declared. (pupa_upper_mem): Likewise. (pupa_gate_a20): Don't export, because turning off Gate A20 in a module is too dangerous. * include/pupa/loader.h (pupa_os_area_addr): Declared. (pupa_os_area_size): Likewise. (pupa_loader_set): Remove the first argument. Loader doesn't manage modules or initrd any longer. (pupa_loader_load_module): Removed. * conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod. (linux_mod_SOURCES): New variable. (linux_mod_CFLAGS): Likewise.
2003-01-17 02:52:05 +00:00
# For ext2.mod.
ext2_mod_SOURCES = fs/ext2.c
CLEANFILES += ext2.mod mod-ext2.o mod-ext2.c pre-ext2.o ext2_mod-fs_ext2.o def-ext2.lst und-ext2.lst
MOSTLYCLEANFILES += ext2_mod-fs_ext2.d
DEFSYMFILES += def-ext2.lst
UNDSYMFILES += und-ext2.lst
ext2.mod: pre-ext2.o mod-ext2.o
-rm -f $@
$(LD) -r -o $@ $^
$(STRIP) --strip-unneeded -K pupa_mod_init -K pupa_mod_fini -R .note -R .comment $@
pre-ext2.o: ext2_mod-fs_ext2.o
-rm -f $@
$(LD) -r -o $@ $^
mod-ext2.o: mod-ext2.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
mod-ext2.c: moddep.lst genmodsrc.sh
sh $(srcdir)/genmodsrc.sh 'ext2' $< > $@ || (rm -f $@; exit 1)
def-ext2.lst: pre-ext2.o
$(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ext2/' > $@
und-ext2.lst: pre-ext2.o
echo 'ext2' > $@
$(NM) -u -P -p $< | cut -f1 -d' ' >> $@
ext2_mod-fs_ext2.o: fs/ext2.c
$(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $<
ext2_mod-fs_ext2.d: fs/ext2.c
set -e; $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) $(ext2_mod_CFLAGS) -M $< | sed 's,ext2\.o[ :]*,ext2_mod-fs_ext2.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include ext2_mod-fs_ext2.d
ext2_mod_CFLAGS = $(COMMON_CFLAGS)
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
# For _linux.mod.
_linux_mod_SOURCES = loader/i386/pc/linux.c
CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_i386_pc_linux.o def-_linux.lst und-_linux.lst
MOSTLYCLEANFILES += _linux_mod-loader_i386_pc_linux.d
DEFSYMFILES += def-_linux.lst
UNDSYMFILES += und-_linux.lst
2003-01-17 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/i386/pc/linux.h: New file. * loader/i386/pc/linux.c: Likewise. * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector): Removed. (pupa_chainloader_unload): Return PUPA_ERR_NONE. (pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead of PUPA_CHAINLOADER_BOOT_SECTOR. * kern/i386/pc/startup.S: Include pupa/machine/linux.h. (pupa_linux_prot_size): New variable. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): New function. (pupa_linux_boot_bzimage): Likewise. * kern/i386/pc/init.c (struct mem_region): New structure. (MAX_REGIONS): New macro. (mem_regions): New variable. (num_regions): Likewise. (pupa_os_area_addr): Likewise. (pupa_os_area_size): Likewise. (pupa_lower_mem): Likewise. (pupa_upper_mem): Likewise. (add_mem_region): New function. (compact_mem_regions): Likewise. (pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to the size of the conventional memory and that of so-called upper memory (before the first memory hole). Instead of adding each found region to free memory, use add_mem_region and add them after removing overlaps. Also, add only 1/4 of the upper memory to free memory. The rest is used for loading OS images. Maybe this is ad hoc, but this makes it much easier to relocate OS images when booting. * kern/rescue.c (pupa_rescue_cmd_module): Removed. (pupa_enter_rescue_mode): Don't register initrd and module. * kern/mm.c: Include pupa/dl.h. * kern/main.c: Include pupa/file.h and pupa/device.h. * kern/loader.c (pupa_loader_load_module_func): Removed. (pupa_loader_load_module): Likewise. * kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of ``.o''. * include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): Likewise. (pupa_linux_boot_bzimage): Likewise. * include/pupa/i386/pc/init.h (pupa_lower_mem): Declared. (pupa_upper_mem): Likewise. (pupa_gate_a20): Don't export, because turning off Gate A20 in a module is too dangerous. * include/pupa/loader.h (pupa_os_area_addr): Declared. (pupa_os_area_size): Likewise. (pupa_loader_set): Remove the first argument. Loader doesn't manage modules or initrd any longer. (pupa_loader_load_module): Removed. * conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod. (linux_mod_SOURCES): New variable. (linux_mod_CFLAGS): Likewise.
2003-01-17 02:52:05 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
_linux.mod: pre-_linux.o mod-_linux.o
2003-01-17 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/i386/pc/linux.h: New file. * loader/i386/pc/linux.c: Likewise. * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector): Removed. (pupa_chainloader_unload): Return PUPA_ERR_NONE. (pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead of PUPA_CHAINLOADER_BOOT_SECTOR. * kern/i386/pc/startup.S: Include pupa/machine/linux.h. (pupa_linux_prot_size): New variable. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): New function. (pupa_linux_boot_bzimage): Likewise. * kern/i386/pc/init.c (struct mem_region): New structure. (MAX_REGIONS): New macro. (mem_regions): New variable. (num_regions): Likewise. (pupa_os_area_addr): Likewise. (pupa_os_area_size): Likewise. (pupa_lower_mem): Likewise. (pupa_upper_mem): Likewise. (add_mem_region): New function. (compact_mem_regions): Likewise. (pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to the size of the conventional memory and that of so-called upper memory (before the first memory hole). Instead of adding each found region to free memory, use add_mem_region and add them after removing overlaps. Also, add only 1/4 of the upper memory to free memory. The rest is used for loading OS images. Maybe this is ad hoc, but this makes it much easier to relocate OS images when booting. * kern/rescue.c (pupa_rescue_cmd_module): Removed. (pupa_enter_rescue_mode): Don't register initrd and module. * kern/mm.c: Include pupa/dl.h. * kern/main.c: Include pupa/file.h and pupa/device.h. * kern/loader.c (pupa_loader_load_module_func): Removed. (pupa_loader_load_module): Likewise. * kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of ``.o''. * include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): Likewise. (pupa_linux_boot_bzimage): Likewise. * include/pupa/i386/pc/init.h (pupa_lower_mem): Declared. (pupa_upper_mem): Likewise. (pupa_gate_a20): Don't export, because turning off Gate A20 in a module is too dangerous. * include/pupa/loader.h (pupa_os_area_addr): Declared. (pupa_os_area_size): Likewise. (pupa_loader_set): Remove the first argument. Loader doesn't manage modules or initrd any longer. (pupa_loader_load_module): Removed. * conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod. (linux_mod_SOURCES): New variable. (linux_mod_CFLAGS): Likewise.
2003-01-17 02:52:05 +00:00
-rm -f $@
$(LD) -r -o $@ $^
$(STRIP) --strip-unneeded -K pupa_mod_init -K pupa_mod_fini -R .note -R .comment $@
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
pre-_linux.o: _linux_mod-loader_i386_pc_linux.o
2003-01-17 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/i386/pc/linux.h: New file. * loader/i386/pc/linux.c: Likewise. * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector): Removed. (pupa_chainloader_unload): Return PUPA_ERR_NONE. (pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead of PUPA_CHAINLOADER_BOOT_SECTOR. * kern/i386/pc/startup.S: Include pupa/machine/linux.h. (pupa_linux_prot_size): New variable. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): New function. (pupa_linux_boot_bzimage): Likewise. * kern/i386/pc/init.c (struct mem_region): New structure. (MAX_REGIONS): New macro. (mem_regions): New variable. (num_regions): Likewise. (pupa_os_area_addr): Likewise. (pupa_os_area_size): Likewise. (pupa_lower_mem): Likewise. (pupa_upper_mem): Likewise. (add_mem_region): New function. (compact_mem_regions): Likewise. (pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to the size of the conventional memory and that of so-called upper memory (before the first memory hole). Instead of adding each found region to free memory, use add_mem_region and add them after removing overlaps. Also, add only 1/4 of the upper memory to free memory. The rest is used for loading OS images. Maybe this is ad hoc, but this makes it much easier to relocate OS images when booting. * kern/rescue.c (pupa_rescue_cmd_module): Removed. (pupa_enter_rescue_mode): Don't register initrd and module. * kern/mm.c: Include pupa/dl.h. * kern/main.c: Include pupa/file.h and pupa/device.h. * kern/loader.c (pupa_loader_load_module_func): Removed. (pupa_loader_load_module): Likewise. * kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of ``.o''. * include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): Likewise. (pupa_linux_boot_bzimage): Likewise. * include/pupa/i386/pc/init.h (pupa_lower_mem): Declared. (pupa_upper_mem): Likewise. (pupa_gate_a20): Don't export, because turning off Gate A20 in a module is too dangerous. * include/pupa/loader.h (pupa_os_area_addr): Declared. (pupa_os_area_size): Likewise. (pupa_loader_set): Remove the first argument. Loader doesn't manage modules or initrd any longer. (pupa_loader_load_module): Removed. * conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod. (linux_mod_SOURCES): New variable. (linux_mod_CFLAGS): Likewise.
2003-01-17 02:52:05 +00:00
-rm -f $@
$(LD) -r -o $@ $^
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
mod-_linux.o: mod-_linux.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
2003-01-17 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/i386/pc/linux.h: New file. * loader/i386/pc/linux.c: Likewise. * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector): Removed. (pupa_chainloader_unload): Return PUPA_ERR_NONE. (pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead of PUPA_CHAINLOADER_BOOT_SECTOR. * kern/i386/pc/startup.S: Include pupa/machine/linux.h. (pupa_linux_prot_size): New variable. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): New function. (pupa_linux_boot_bzimage): Likewise. * kern/i386/pc/init.c (struct mem_region): New structure. (MAX_REGIONS): New macro. (mem_regions): New variable. (num_regions): Likewise. (pupa_os_area_addr): Likewise. (pupa_os_area_size): Likewise. (pupa_lower_mem): Likewise. (pupa_upper_mem): Likewise. (add_mem_region): New function. (compact_mem_regions): Likewise. (pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to the size of the conventional memory and that of so-called upper memory (before the first memory hole). Instead of adding each found region to free memory, use add_mem_region and add them after removing overlaps. Also, add only 1/4 of the upper memory to free memory. The rest is used for loading OS images. Maybe this is ad hoc, but this makes it much easier to relocate OS images when booting. * kern/rescue.c (pupa_rescue_cmd_module): Removed. (pupa_enter_rescue_mode): Don't register initrd and module. * kern/mm.c: Include pupa/dl.h. * kern/main.c: Include pupa/file.h and pupa/device.h. * kern/loader.c (pupa_loader_load_module_func): Removed. (pupa_loader_load_module): Likewise. * kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of ``.o''. * include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): Likewise. (pupa_linux_boot_bzimage): Likewise. * include/pupa/i386/pc/init.h (pupa_lower_mem): Declared. (pupa_upper_mem): Likewise. (pupa_gate_a20): Don't export, because turning off Gate A20 in a module is too dangerous. * include/pupa/loader.h (pupa_os_area_addr): Declared. (pupa_os_area_size): Likewise. (pupa_loader_set): Remove the first argument. Loader doesn't manage modules or initrd any longer. (pupa_loader_load_module): Removed. * conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod. (linux_mod_SOURCES): New variable. (linux_mod_CFLAGS): Likewise.
2003-01-17 02:52:05 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
mod-_linux.c: moddep.lst genmodsrc.sh
sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1)
2003-01-17 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/i386/pc/linux.h: New file. * loader/i386/pc/linux.c: Likewise. * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector): Removed. (pupa_chainloader_unload): Return PUPA_ERR_NONE. (pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead of PUPA_CHAINLOADER_BOOT_SECTOR. * kern/i386/pc/startup.S: Include pupa/machine/linux.h. (pupa_linux_prot_size): New variable. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): New function. (pupa_linux_boot_bzimage): Likewise. * kern/i386/pc/init.c (struct mem_region): New structure. (MAX_REGIONS): New macro. (mem_regions): New variable. (num_regions): Likewise. (pupa_os_area_addr): Likewise. (pupa_os_area_size): Likewise. (pupa_lower_mem): Likewise. (pupa_upper_mem): Likewise. (add_mem_region): New function. (compact_mem_regions): Likewise. (pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to the size of the conventional memory and that of so-called upper memory (before the first memory hole). Instead of adding each found region to free memory, use add_mem_region and add them after removing overlaps. Also, add only 1/4 of the upper memory to free memory. The rest is used for loading OS images. Maybe this is ad hoc, but this makes it much easier to relocate OS images when booting. * kern/rescue.c (pupa_rescue_cmd_module): Removed. (pupa_enter_rescue_mode): Don't register initrd and module. * kern/mm.c: Include pupa/dl.h. * kern/main.c: Include pupa/file.h and pupa/device.h. * kern/loader.c (pupa_loader_load_module_func): Removed. (pupa_loader_load_module): Likewise. * kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of ``.o''. * include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): Likewise. (pupa_linux_boot_bzimage): Likewise. * include/pupa/i386/pc/init.h (pupa_lower_mem): Declared. (pupa_upper_mem): Likewise. (pupa_gate_a20): Don't export, because turning off Gate A20 in a module is too dangerous. * include/pupa/loader.h (pupa_os_area_addr): Declared. (pupa_os_area_size): Likewise. (pupa_loader_set): Remove the first argument. Loader doesn't manage modules or initrd any longer. (pupa_loader_load_module): Removed. * conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod. (linux_mod_SOURCES): New variable. (linux_mod_CFLAGS): Likewise.
2003-01-17 02:52:05 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
def-_linux.lst: pre-_linux.o
$(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _linux/' > $@
2003-01-17 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/i386/pc/linux.h: New file. * loader/i386/pc/linux.c: Likewise. * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector): Removed. (pupa_chainloader_unload): Return PUPA_ERR_NONE. (pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead of PUPA_CHAINLOADER_BOOT_SECTOR. * kern/i386/pc/startup.S: Include pupa/machine/linux.h. (pupa_linux_prot_size): New variable. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): New function. (pupa_linux_boot_bzimage): Likewise. * kern/i386/pc/init.c (struct mem_region): New structure. (MAX_REGIONS): New macro. (mem_regions): New variable. (num_regions): Likewise. (pupa_os_area_addr): Likewise. (pupa_os_area_size): Likewise. (pupa_lower_mem): Likewise. (pupa_upper_mem): Likewise. (add_mem_region): New function. (compact_mem_regions): Likewise. (pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to the size of the conventional memory and that of so-called upper memory (before the first memory hole). Instead of adding each found region to free memory, use add_mem_region and add them after removing overlaps. Also, add only 1/4 of the upper memory to free memory. The rest is used for loading OS images. Maybe this is ad hoc, but this makes it much easier to relocate OS images when booting. * kern/rescue.c (pupa_rescue_cmd_module): Removed. (pupa_enter_rescue_mode): Don't register initrd and module. * kern/mm.c: Include pupa/dl.h. * kern/main.c: Include pupa/file.h and pupa/device.h. * kern/loader.c (pupa_loader_load_module_func): Removed. (pupa_loader_load_module): Likewise. * kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of ``.o''. * include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): Likewise. (pupa_linux_boot_bzimage): Likewise. * include/pupa/i386/pc/init.h (pupa_lower_mem): Declared. (pupa_upper_mem): Likewise. (pupa_gate_a20): Don't export, because turning off Gate A20 in a module is too dangerous. * include/pupa/loader.h (pupa_os_area_addr): Declared. (pupa_os_area_size): Likewise. (pupa_loader_set): Remove the first argument. Loader doesn't manage modules or initrd any longer. (pupa_loader_load_module): Removed. * conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod. (linux_mod_SOURCES): New variable. (linux_mod_CFLAGS): Likewise.
2003-01-17 02:52:05 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
und-_linux.lst: pre-_linux.o
echo '_linux' > $@
$(NM) -u -P -p $< | cut -f1 -d' ' >> $@
2003-01-17 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/i386/pc/linux.h: New file. * loader/i386/pc/linux.c: Likewise. * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector): Removed. (pupa_chainloader_unload): Return PUPA_ERR_NONE. (pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead of PUPA_CHAINLOADER_BOOT_SECTOR. * kern/i386/pc/startup.S: Include pupa/machine/linux.h. (pupa_linux_prot_size): New variable. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): New function. (pupa_linux_boot_bzimage): Likewise. * kern/i386/pc/init.c (struct mem_region): New structure. (MAX_REGIONS): New macro. (mem_regions): New variable. (num_regions): Likewise. (pupa_os_area_addr): Likewise. (pupa_os_area_size): Likewise. (pupa_lower_mem): Likewise. (pupa_upper_mem): Likewise. (add_mem_region): New function. (compact_mem_regions): Likewise. (pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to the size of the conventional memory and that of so-called upper memory (before the first memory hole). Instead of adding each found region to free memory, use add_mem_region and add them after removing overlaps. Also, add only 1/4 of the upper memory to free memory. The rest is used for loading OS images. Maybe this is ad hoc, but this makes it much easier to relocate OS images when booting. * kern/rescue.c (pupa_rescue_cmd_module): Removed. (pupa_enter_rescue_mode): Don't register initrd and module. * kern/mm.c: Include pupa/dl.h. * kern/main.c: Include pupa/file.h and pupa/device.h. * kern/loader.c (pupa_loader_load_module_func): Removed. (pupa_loader_load_module): Likewise. * kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of ``.o''. * include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): Likewise. (pupa_linux_boot_bzimage): Likewise. * include/pupa/i386/pc/init.h (pupa_lower_mem): Declared. (pupa_upper_mem): Likewise. (pupa_gate_a20): Don't export, because turning off Gate A20 in a module is too dangerous. * include/pupa/loader.h (pupa_os_area_addr): Declared. (pupa_os_area_size): Likewise. (pupa_loader_set): Remove the first argument. Loader doesn't manage modules or initrd any longer. (pupa_loader_load_module): Removed. * conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod. (linux_mod_SOURCES): New variable. (linux_mod_CFLAGS): Likewise.
2003-01-17 02:52:05 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
_linux_mod-loader_i386_pc_linux.o: loader/i386/pc/linux.c
$(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $<
2003-01-17 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/i386/pc/linux.h: New file. * loader/i386/pc/linux.c: Likewise. * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector): Removed. (pupa_chainloader_unload): Return PUPA_ERR_NONE. (pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead of PUPA_CHAINLOADER_BOOT_SECTOR. * kern/i386/pc/startup.S: Include pupa/machine/linux.h. (pupa_linux_prot_size): New variable. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): New function. (pupa_linux_boot_bzimage): Likewise. * kern/i386/pc/init.c (struct mem_region): New structure. (MAX_REGIONS): New macro. (mem_regions): New variable. (num_regions): Likewise. (pupa_os_area_addr): Likewise. (pupa_os_area_size): Likewise. (pupa_lower_mem): Likewise. (pupa_upper_mem): Likewise. (add_mem_region): New function. (compact_mem_regions): Likewise. (pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to the size of the conventional memory and that of so-called upper memory (before the first memory hole). Instead of adding each found region to free memory, use add_mem_region and add them after removing overlaps. Also, add only 1/4 of the upper memory to free memory. The rest is used for loading OS images. Maybe this is ad hoc, but this makes it much easier to relocate OS images when booting. * kern/rescue.c (pupa_rescue_cmd_module): Removed. (pupa_enter_rescue_mode): Don't register initrd and module. * kern/mm.c: Include pupa/dl.h. * kern/main.c: Include pupa/file.h and pupa/device.h. * kern/loader.c (pupa_loader_load_module_func): Removed. (pupa_loader_load_module): Likewise. * kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of ``.o''. * include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): Likewise. (pupa_linux_boot_bzimage): Likewise. * include/pupa/i386/pc/init.h (pupa_lower_mem): Declared. (pupa_upper_mem): Likewise. (pupa_gate_a20): Don't export, because turning off Gate A20 in a module is too dangerous. * include/pupa/loader.h (pupa_os_area_addr): Declared. (pupa_os_area_size): Likewise. (pupa_loader_set): Remove the first argument. Loader doesn't manage modules or initrd any longer. (pupa_loader_load_module): Removed. * conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod. (linux_mod_SOURCES): New variable. (linux_mod_CFLAGS): Likewise.
2003-01-17 02:52:05 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
_linux_mod-loader_i386_pc_linux.d: loader/i386/pc/linux.c
set -e; $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_linux_mod_CFLAGS) -M $< | sed 's,linux\.o[ :]*,_linux_mod-loader_i386_pc_linux.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
2003-01-17 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/i386/pc/linux.h: New file. * loader/i386/pc/linux.c: Likewise. * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector): Removed. (pupa_chainloader_unload): Return PUPA_ERR_NONE. (pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead of PUPA_CHAINLOADER_BOOT_SECTOR. * kern/i386/pc/startup.S: Include pupa/machine/linux.h. (pupa_linux_prot_size): New variable. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): New function. (pupa_linux_boot_bzimage): Likewise. * kern/i386/pc/init.c (struct mem_region): New structure. (MAX_REGIONS): New macro. (mem_regions): New variable. (num_regions): Likewise. (pupa_os_area_addr): Likewise. (pupa_os_area_size): Likewise. (pupa_lower_mem): Likewise. (pupa_upper_mem): Likewise. (add_mem_region): New function. (compact_mem_regions): Likewise. (pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to the size of the conventional memory and that of so-called upper memory (before the first memory hole). Instead of adding each found region to free memory, use add_mem_region and add them after removing overlaps. Also, add only 1/4 of the upper memory to free memory. The rest is used for loading OS images. Maybe this is ad hoc, but this makes it much easier to relocate OS images when booting. * kern/rescue.c (pupa_rescue_cmd_module): Removed. (pupa_enter_rescue_mode): Don't register initrd and module. * kern/mm.c: Include pupa/dl.h. * kern/main.c: Include pupa/file.h and pupa/device.h. * kern/loader.c (pupa_loader_load_module_func): Removed. (pupa_loader_load_module): Likewise. * kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of ``.o''. * include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): Likewise. (pupa_linux_boot_bzimage): Likewise. * include/pupa/i386/pc/init.h (pupa_lower_mem): Declared. (pupa_upper_mem): Likewise. (pupa_gate_a20): Don't export, because turning off Gate A20 in a module is too dangerous. * include/pupa/loader.h (pupa_os_area_addr): Declared. (pupa_os_area_size): Likewise. (pupa_loader_set): Remove the first argument. Loader doesn't manage modules or initrd any longer. (pupa_loader_load_module): Removed. * conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod. (linux_mod_SOURCES): New variable. (linux_mod_CFLAGS): Likewise.
2003-01-17 02:52:05 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
-include _linux_mod-loader_i386_pc_linux.d
2003-01-17 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/i386/pc/linux.h: New file. * loader/i386/pc/linux.c: Likewise. * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector): Removed. (pupa_chainloader_unload): Return PUPA_ERR_NONE. (pupa_rescue_cmd_chainloader): Read the image to 0x7C00 instead of PUPA_CHAINLOADER_BOOT_SECTOR. * kern/i386/pc/startup.S: Include pupa/machine/linux.h. (pupa_linux_prot_size): New variable. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): New function. (pupa_linux_boot_bzimage): Likewise. * kern/i386/pc/init.c (struct mem_region): New structure. (MAX_REGIONS): New macro. (mem_regions): New variable. (num_regions): Likewise. (pupa_os_area_addr): Likewise. (pupa_os_area_size): Likewise. (pupa_lower_mem): Likewise. (pupa_upper_mem): Likewise. (add_mem_region): New function. (compact_mem_regions): Likewise. (pupa_machine_init): Set PUPA_LOWER_MEM and PUPA_UPPER_MEM to the size of the conventional memory and that of so-called upper memory (before the first memory hole). Instead of adding each found region to free memory, use add_mem_region and add them after removing overlaps. Also, add only 1/4 of the upper memory to free memory. The rest is used for loading OS images. Maybe this is ad hoc, but this makes it much easier to relocate OS images when booting. * kern/rescue.c (pupa_rescue_cmd_module): Removed. (pupa_enter_rescue_mode): Don't register initrd and module. * kern/mm.c: Include pupa/dl.h. * kern/main.c: Include pupa/file.h and pupa/device.h. * kern/loader.c (pupa_loader_load_module_func): Removed. (pupa_loader_load_module): Likewise. * kern/dl.c (pupa_dl_load): Use the suffix ``.mod'' instead of ``.o''. * include/pupa/i386/pc/loader.h (pupa_linux_prot_size): Declared. (pupa_linux_tmp_addr): Likewise. (pupa_linux_real_addr): Likewise. (pupa_linux_boot_zimage): Likewise. (pupa_linux_boot_bzimage): Likewise. * include/pupa/i386/pc/init.h (pupa_lower_mem): Declared. (pupa_upper_mem): Likewise. (pupa_gate_a20): Don't export, because turning off Gate A20 in a module is too dangerous. * include/pupa/loader.h (pupa_os_area_addr): Declared. (pupa_os_area_size): Likewise. (pupa_loader_set): Remove the first argument. Loader doesn't manage modules or initrd any longer. (pupa_loader_load_module): Removed. * conf/i386-pc.rmk (pkgdata_MODULES): Added linux.mod. (linux_mod_SOURCES): New variable. (linux_mod_CFLAGS): Likewise.
2003-01-17 02:52:05 +00:00
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
_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
CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_i386_setjmp.o def-normal.lst und-normal.lst
MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_i386_setjmp.d
DEFSYMFILES += def-normal.lst
UNDSYMFILES += und-normal.lst
normal.mod: pre-normal.o mod-normal.o
-rm -f $@
$(LD) -r -o $@ $^
$(STRIP) --strip-unneeded -K pupa_mod_init -K pupa_mod_fini -R .note -R .comment $@
pre-normal.o: normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_i386_setjmp.o
-rm -f $@
$(LD) -r -o $@ $^
mod-normal.o: mod-normal.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
mod-normal.c: moddep.lst genmodsrc.sh
sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1)
def-normal.lst: pre-normal.o
$(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 normal/' > $@
und-normal.lst: pre-normal.o
echo 'normal' > $@
$(NM) -u -P -p $< | cut -f1 -d' ' >> $@
2003-01-20 Yoshinori K. Okuji <okuji@enbug.org> * include/pupa/normal.h: New file. * include/pupa/setjmp.h: Likewise. * include/pupa/i386/setjmp.h: Likewise. * normal/cmdline.c: Likewise. * normal/command.c: Likewise. * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. * loader/i386/pc/chainloader.c (pupa_rescue_cmd_chainloader): Likewise. * kern/i386/pc/startup.S (translation_table): New variable. (translate_keycode): New function. (pupa_console_getkey): Call translate_keycode. * kern/rescue.c (attempt_normal_mode): New function. (pupa_enter_rescue_mode): Attempt to execute the normal mode. If it failed, print a message. * kern/mm.c (pupa_real_malloc): Print more information when a free magic is broken. (pupa_free): If the first free header is not free actually, set it to P. * kern/main.c (pupa_load_normal_mode): Just load the module "normal". (pupa_main): Don't print the message "Entering into rescue mode..." here. * include/pupa/i386/pc/loader.h (pupa_rescue_cmd_initrd): Declared. (pupa_rescue_cmd_initrd): Likewise. (pupa_rescue_cmd_initrd): Likewise. * include/pupa/symbol.h (FUNCTION): Specify the type. (VARIABLE): Likewise. * include/pupa/err.h (pupa_err_t): Added PUPA_ERR_UNKNOWN_COMMAND. * include/pupa/dl.h (pupa_dl_set_prefix): Exported. (pupa_dl_get_prefix): Likewise. * conf/i386-pc.rmk (pkgdata_MODULES): Added normal.mod. Added _chain.mod and _linux.mod instead of chain.mod and linux.mod. (chain_mod_SOURCES): Renamed to ... (_chain_mod_SOURCES): ... this. (chain_mod_CFLAGS): Renamed to ... (_chain_mod_CFLAGS): ... this. (linux_mod_SOURCES): Renamed to ... (_linux_mod_SOURCES): ... this. (linux_mod_CFLAGS): Renamed to ... (_linux_mod_CFLAGS): ... this. (normal_mod_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_ASFLAGS): Likewise. 2003-01-18 Yoshinori K. Okuji <okuji@enbug.org> * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. * kern/dl.c (pupa_dl_ref): Refer dependending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if a module is unloaded before one depending on that module is unloaded. (pupa_dl_unload): Unload depending modules explicitly, if possible.
2003-01-20 04:13:46 +00:00
normal_mod-normal_cmdline.o: normal/cmdline.c
$(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
normal_mod-normal_cmdline.d: normal/cmdline.c
set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $< | sed 's,cmdline\.o[ :]*,normal_mod-normal_cmdline.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include normal_mod-normal_cmdline.d
normal_mod-normal_command.o: normal/command.c
$(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
normal_mod-normal_command.d: normal/command.c
set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $< | sed 's,command\.o[ :]*,normal_mod-normal_command.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include normal_mod-normal_command.d
normal_mod-normal_main.o: normal/main.c
$(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
normal_mod-normal_main.d: normal/main.c
set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $< | sed 's,main\.o[ :]*,normal_mod-normal_main.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include normal_mod-normal_main.d
normal_mod-normal_menu.o: normal/menu.c
$(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $<
normal_mod-normal_menu.d: normal/menu.c
set -e; $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) $(normal_mod_CFLAGS) -M $< | sed 's,menu\.o[ :]*,normal_mod-normal_menu.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include normal_mod-normal_menu.d
normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S
$(CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -c -o $@ $<
normal_mod-normal_i386_setjmp.d: normal/i386/setjmp.S
set -e; $(CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(CPPFLAGS) $(ASFLAGS) $(normal_mod_ASFLAGS) -M $< | sed 's,setjmp\.o[ :]*,normal_mod-normal_i386_setjmp.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include normal_mod-normal_i386_setjmp.d
normal_mod_CFLAGS = $(COMMON_CFLAGS)
normal_mod_ASFLAGS = $(COMMON_ASFLAGS)
2003-09-25 Yoshinori K. Okuji <okuji@enbug.org> I forgot to check in these changes for a long time. This adds incomplete support for VGA console, and this is still very buggy. Also, a lot of consideration is required for I18N, UNICODE, and VGA font issues. Therefore, assume that this is such that "better than nothing". * font/manager.c: New file. * include/pupa/font.h: Likewise. * include/pupa/i386/pc/vga.h: Likewise. * term/i386/pc/vga.c: Likewise. * util/unifont2pff.rb: Likewise. * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/vga.h. (pkgdata_MODULES): Added vga.mod and font.mod. (vga_mod_SOURCES): New variables. (vga_mod_CFLAGS): Likewise. (font_mod_SOURCES): Likewise. (font_mod_CFLAGS): Likewise. * include/pupa/err.h (PUPA_ERR_BAD_FONT): New constant. * include/pupa/term.h: Include pupa/err.h. (struct pupa_term): Added init and fini. Changed the argument of putchar to pupa_uint32_t. * include/pupa/i386/pc/console.h: Include pupa/symbol.h. (pupa_console_real_putchar): New prototype. (pupa_console_putchar): Removed. (pupa_console_checkkey): Exported. (pupa_console_getkey): Likewise. * kern/misc.c (pupa_vsprintf): Add support for UNICODE characters. * kern/term.c (pupa_term_set_current): Rewritten. (pupa_putchar): Likewise. (pupa_putcode): New function. * kern/i386/pc/startup.S (pupa_console_putchar): Renamed to ... (pupa_console_real_putchar): ... this. (pupa_vga_set_mode): New function. (pupa_vga_get_font): Likewise. * normal/command.c: Include pupa/term.h. (terminal_command): New function. (pupa_command_init): Register the command "terminal". * normal/menu.c (DISP_LEFT): Changed to a UNICODE value. (DISP_UP): Likewise. (DISP_RIGHT): Likewise. (DISP_DOWN): Likewise. (DISP_HLINE): Likewise. (DISP_VLINE): Likewise. (DISP_UL): Likewise. (DISP_UR): Likewise. (DISP_LL): Likewise. (DISP_LR): Likewise. * term/i386/pc/console.c (pupa_console_putchar): New function.
2003-09-25 20:15:53 +00:00
# For hello.mod.
hello_mod_SOURCES = hello/hello.c
CLEANFILES += hello.mod mod-hello.o mod-hello.c pre-hello.o hello_mod-hello_hello.o def-hello.lst und-hello.lst
MOSTLYCLEANFILES += hello_mod-hello_hello.d
DEFSYMFILES += def-hello.lst
UNDSYMFILES += und-hello.lst
hello.mod: pre-hello.o mod-hello.o
-rm -f $@
$(LD) -r -o $@ $^
$(STRIP) --strip-unneeded -K pupa_mod_init -K pupa_mod_fini -R .note -R .comment $@
pre-hello.o: hello_mod-hello_hello.o
-rm -f $@
$(LD) -r -o $@ $^
mod-hello.o: mod-hello.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
mod-hello.c: moddep.lst genmodsrc.sh
sh $(srcdir)/genmodsrc.sh 'hello' $< > $@ || (rm -f $@; exit 1)
def-hello.lst: pre-hello.o
$(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hello/' > $@
und-hello.lst: pre-hello.o
echo 'hello' > $@
$(NM) -u -P -p $< | cut -f1 -d' ' >> $@
2003-09-25 Yoshinori K. Okuji <okuji@enbug.org> I forgot to check in these changes for a long time. This adds incomplete support for VGA console, and this is still very buggy. Also, a lot of consideration is required for I18N, UNICODE, and VGA font issues. Therefore, assume that this is such that "better than nothing". * font/manager.c: New file. * include/pupa/font.h: Likewise. * include/pupa/i386/pc/vga.h: Likewise. * term/i386/pc/vga.c: Likewise. * util/unifont2pff.rb: Likewise. * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/vga.h. (pkgdata_MODULES): Added vga.mod and font.mod. (vga_mod_SOURCES): New variables. (vga_mod_CFLAGS): Likewise. (font_mod_SOURCES): Likewise. (font_mod_CFLAGS): Likewise. * include/pupa/err.h (PUPA_ERR_BAD_FONT): New constant. * include/pupa/term.h: Include pupa/err.h. (struct pupa_term): Added init and fini. Changed the argument of putchar to pupa_uint32_t. * include/pupa/i386/pc/console.h: Include pupa/symbol.h. (pupa_console_real_putchar): New prototype. (pupa_console_putchar): Removed. (pupa_console_checkkey): Exported. (pupa_console_getkey): Likewise. * kern/misc.c (pupa_vsprintf): Add support for UNICODE characters. * kern/term.c (pupa_term_set_current): Rewritten. (pupa_putchar): Likewise. (pupa_putcode): New function. * kern/i386/pc/startup.S (pupa_console_putchar): Renamed to ... (pupa_console_real_putchar): ... this. (pupa_vga_set_mode): New function. (pupa_vga_get_font): Likewise. * normal/command.c: Include pupa/term.h. (terminal_command): New function. (pupa_command_init): Register the command "terminal". * normal/menu.c (DISP_LEFT): Changed to a UNICODE value. (DISP_UP): Likewise. (DISP_RIGHT): Likewise. (DISP_DOWN): Likewise. (DISP_HLINE): Likewise. (DISP_VLINE): Likewise. (DISP_UL): Likewise. (DISP_UR): Likewise. (DISP_LL): Likewise. (DISP_LR): Likewise. * term/i386/pc/console.c (pupa_console_putchar): New function.
2003-09-25 20:15:53 +00:00
hello_mod-hello_hello.o: hello/hello.c
$(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $<
hello_mod-hello_hello.d: hello/hello.c
set -e; $(CC) -Ihello -I$(srcdir)/hello $(CPPFLAGS) $(CFLAGS) $(hello_mod_CFLAGS) -M $< | sed 's,hello\.o[ :]*,hello_mod-hello_hello.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include hello_mod-hello_hello.d
hello_mod_CFLAGS = $(COMMON_CFLAGS)
# For vga.mod.
vga_mod_SOURCES = term/i386/pc/vga.c
CLEANFILES += vga.mod mod-vga.o mod-vga.c pre-vga.o vga_mod-term_i386_pc_vga.o def-vga.lst und-vga.lst
MOSTLYCLEANFILES += vga_mod-term_i386_pc_vga.d
DEFSYMFILES += def-vga.lst
UNDSYMFILES += und-vga.lst
vga.mod: pre-vga.o mod-vga.o
-rm -f $@
$(LD) -r -o $@ $^
$(STRIP) --strip-unneeded -K pupa_mod_init -K pupa_mod_fini -R .note -R .comment $@
pre-vga.o: vga_mod-term_i386_pc_vga.o
-rm -f $@
$(LD) -r -o $@ $^
mod-vga.o: mod-vga.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(vga_mod_CFLAGS) -c -o $@ $<
mod-vga.c: moddep.lst genmodsrc.sh
sh $(srcdir)/genmodsrc.sh 'vga' $< > $@ || (rm -f $@; exit 1)
def-vga.lst: pre-vga.o
$(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 vga/' > $@
und-vga.lst: pre-vga.o
echo 'vga' > $@
$(NM) -u -P -p $< | cut -f1 -d' ' >> $@
2003-09-25 Yoshinori K. Okuji <okuji@enbug.org> I forgot to check in these changes for a long time. This adds incomplete support for VGA console, and this is still very buggy. Also, a lot of consideration is required for I18N, UNICODE, and VGA font issues. Therefore, assume that this is such that "better than nothing". * font/manager.c: New file. * include/pupa/font.h: Likewise. * include/pupa/i386/pc/vga.h: Likewise. * term/i386/pc/vga.c: Likewise. * util/unifont2pff.rb: Likewise. * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/vga.h. (pkgdata_MODULES): Added vga.mod and font.mod. (vga_mod_SOURCES): New variables. (vga_mod_CFLAGS): Likewise. (font_mod_SOURCES): Likewise. (font_mod_CFLAGS): Likewise. * include/pupa/err.h (PUPA_ERR_BAD_FONT): New constant. * include/pupa/term.h: Include pupa/err.h. (struct pupa_term): Added init and fini. Changed the argument of putchar to pupa_uint32_t. * include/pupa/i386/pc/console.h: Include pupa/symbol.h. (pupa_console_real_putchar): New prototype. (pupa_console_putchar): Removed. (pupa_console_checkkey): Exported. (pupa_console_getkey): Likewise. * kern/misc.c (pupa_vsprintf): Add support for UNICODE characters. * kern/term.c (pupa_term_set_current): Rewritten. (pupa_putchar): Likewise. (pupa_putcode): New function. * kern/i386/pc/startup.S (pupa_console_putchar): Renamed to ... (pupa_console_real_putchar): ... this. (pupa_vga_set_mode): New function. (pupa_vga_get_font): Likewise. * normal/command.c: Include pupa/term.h. (terminal_command): New function. (pupa_command_init): Register the command "terminal". * normal/menu.c (DISP_LEFT): Changed to a UNICODE value. (DISP_UP): Likewise. (DISP_RIGHT): Likewise. (DISP_DOWN): Likewise. (DISP_HLINE): Likewise. (DISP_VLINE): Likewise. (DISP_UL): Likewise. (DISP_UR): Likewise. (DISP_LL): Likewise. (DISP_LR): Likewise. * term/i386/pc/console.c (pupa_console_putchar): New function.
2003-09-25 20:15:53 +00:00
vga_mod-term_i386_pc_vga.o: term/i386/pc/vga.c
$(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(vga_mod_CFLAGS) -c -o $@ $<
vga_mod-term_i386_pc_vga.d: term/i386/pc/vga.c
set -e; $(CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(CPPFLAGS) $(CFLAGS) $(vga_mod_CFLAGS) -M $< | sed 's,vga\.o[ :]*,vga_mod-term_i386_pc_vga.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include vga_mod-term_i386_pc_vga.d
vga_mod_CFLAGS = $(COMMON_CFLAGS)
# For font.mod.
font_mod_SOURCES = font/manager.c
CLEANFILES += font.mod mod-font.o mod-font.c pre-font.o font_mod-font_manager.o def-font.lst und-font.lst
MOSTLYCLEANFILES += font_mod-font_manager.d
DEFSYMFILES += def-font.lst
UNDSYMFILES += und-font.lst
font.mod: pre-font.o mod-font.o
-rm -f $@
$(LD) -r -o $@ $^
$(STRIP) --strip-unneeded -K pupa_mod_init -K pupa_mod_fini -R .note -R .comment $@
pre-font.o: font_mod-font_manager.o
-rm -f $@
$(LD) -r -o $@ $^
mod-font.o: mod-font.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
mod-font.c: moddep.lst genmodsrc.sh
sh $(srcdir)/genmodsrc.sh 'font' $< > $@ || (rm -f $@; exit 1)
def-font.lst: pre-font.o
$(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 font/' > $@
und-font.lst: pre-font.o
echo 'font' > $@
$(NM) -u -P -p $< | cut -f1 -d' ' >> $@
2003-09-25 Yoshinori K. Okuji <okuji@enbug.org> I forgot to check in these changes for a long time. This adds incomplete support for VGA console, and this is still very buggy. Also, a lot of consideration is required for I18N, UNICODE, and VGA font issues. Therefore, assume that this is such that "better than nothing". * font/manager.c: New file. * include/pupa/font.h: Likewise. * include/pupa/i386/pc/vga.h: Likewise. * term/i386/pc/vga.c: Likewise. * util/unifont2pff.rb: Likewise. * conf/i386-pc.rmk (kernel_img_HEADERS): Added machine/vga.h. (pkgdata_MODULES): Added vga.mod and font.mod. (vga_mod_SOURCES): New variables. (vga_mod_CFLAGS): Likewise. (font_mod_SOURCES): Likewise. (font_mod_CFLAGS): Likewise. * include/pupa/err.h (PUPA_ERR_BAD_FONT): New constant. * include/pupa/term.h: Include pupa/err.h. (struct pupa_term): Added init and fini. Changed the argument of putchar to pupa_uint32_t. * include/pupa/i386/pc/console.h: Include pupa/symbol.h. (pupa_console_real_putchar): New prototype. (pupa_console_putchar): Removed. (pupa_console_checkkey): Exported. (pupa_console_getkey): Likewise. * kern/misc.c (pupa_vsprintf): Add support for UNICODE characters. * kern/term.c (pupa_term_set_current): Rewritten. (pupa_putchar): Likewise. (pupa_putcode): New function. * kern/i386/pc/startup.S (pupa_console_putchar): Renamed to ... (pupa_console_real_putchar): ... this. (pupa_vga_set_mode): New function. (pupa_vga_get_font): Likewise. * normal/command.c: Include pupa/term.h. (terminal_command): New function. (pupa_command_init): Register the command "terminal". * normal/menu.c (DISP_LEFT): Changed to a UNICODE value. (DISP_UP): Likewise. (DISP_RIGHT): Likewise. (DISP_DOWN): Likewise. (DISP_HLINE): Likewise. (DISP_VLINE): Likewise. (DISP_UL): Likewise. (DISP_UR): Likewise. (DISP_LL): Likewise. (DISP_LR): Likewise. * term/i386/pc/console.c (pupa_console_putchar): New function.
2003-09-25 20:15:53 +00:00
font_mod-font_manager.o: font/manager.c
$(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -c -o $@ $<
font_mod-font_manager.d: font/manager.c
set -e; $(CC) -Ifont -I$(srcdir)/font $(CPPFLAGS) $(CFLAGS) $(font_mod_CFLAGS) -M $< | sed 's,manager\.o[ :]*,font_mod-font_manager.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include font_mod-font_manager.d
font_mod_CFLAGS = $(COMMON_CFLAGS)
# For _multiboot.mod.
_multiboot_mod_SOURCES = loader/i386/pc/multiboot.c
CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_i386_pc_multiboot.o def-_multiboot.lst und-_multiboot.lst
MOSTLYCLEANFILES += _multiboot_mod-loader_i386_pc_multiboot.d
DEFSYMFILES += def-_multiboot.lst
UNDSYMFILES += und-_multiboot.lst
_multiboot.mod: pre-_multiboot.o mod-_multiboot.o
-rm -f $@
$(LD) -r -o $@ $^
$(STRIP) --strip-unneeded -K pupa_mod_init -K pupa_mod_fini -R .note -R .comment $@
pre-_multiboot.o: _multiboot_mod-loader_i386_pc_multiboot.o
-rm -f $@
$(LD) -r -o $@ $^
mod-_multiboot.o: mod-_multiboot.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $<
mod-_multiboot.c: moddep.lst genmodsrc.sh
sh $(srcdir)/genmodsrc.sh '_multiboot' $< > $@ || (rm -f $@; exit 1)
def-_multiboot.lst: pre-_multiboot.o
$(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _multiboot/' > $@
und-_multiboot.lst: pre-_multiboot.o
echo '_multiboot' > $@
$(NM) -u -P -p $< | cut -f1 -d' ' >> $@
_multiboot_mod-loader_i386_pc_multiboot.o: loader/i386/pc/multiboot.c
$(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $<
_multiboot_mod-loader_i386_pc_multiboot.d: loader/i386/pc/multiboot.c
set -e; $(CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(CPPFLAGS) $(CFLAGS) $(_multiboot_mod_CFLAGS) -M $< | sed 's,multiboot\.o[ :]*,_multiboot_mod-loader_i386_pc_multiboot.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
-include _multiboot_mod-loader_i386_pc_multiboot.d
_multiboot_mod_CFLAGS = $(COMMON_CFLAGS)
2002-12-27 08:53:07 +00:00
CLEANFILES += moddep.lst
pkgdata_DATA += moddep.lst
moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep
cat $(DEFSYMFILES) /dev/null | ./genmoddep $(UNDSYMFILES) > $@ \
|| (rm -f $@; exit 1)