2008-01-31 Bean <bean123ch@gmail.com>
* conf/i386-pc.rmk (pkglib_IMAGES): Add cdboot.img. (cdboot_img_SOURCES): New variable. (cdboot_img_ASFLAGS): New variable. (cdboot_img_LDFLAGS): New variable. * boot/i386/pc/cdboot.S: New file. * disk/i386/pc/biosdisk.c (cd_start): New variable. (cd_count): Likewise. (grub_biosdisk_get_drive): Add support for cd device. (grub_biosdisk_call_hook): Likewise. (grub_biosdisk_iterate): Likewise. (grub_biosdisk_open): Likewise. (GRUB_BIOSDISK_CDROM_RETRY_COUNT): New macro. (grub_biosdisk_rw): Support reading from cd device. (GRUB_MOD_INIT): Iterate cd devices. * include/grub/i386/pc/biosdisk.h (GRUB_BIOSDISK_FLAG_CDROM): New macro. (GRUB_BIOSDISK_MACHINE_CDROM_START): Likewise. (GRUB_BIOSDISK_MACHINE_CDROM_END): Likewise. * kern/i386/pc/init.c (make_install_device): Check for cd device.
This commit is contained in:
parent
4020aa53c0
commit
9be665dd11
7 changed files with 317 additions and 26 deletions
|
@ -11,7 +11,8 @@ normal/execute.c_DEPENDENCIES = grub_script.tab.h
|
|||
normal/command.c_DEPENDENCIES = grub_script.tab.h
|
||||
|
||||
# Images.
|
||||
pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img
|
||||
pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \
|
||||
cdboot.img
|
||||
|
||||
# For boot.img.
|
||||
boot_img_SOURCES = boot/i386/pc/boot.S
|
||||
|
@ -85,6 +86,24 @@ lnxboot_img-boot_i386_pc_lnxboot.o: boot/i386/pc/lnxboot.S $(boot/i386/pc/lnxboo
|
|||
lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS)
|
||||
lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,6000
|
||||
|
||||
# For cdboot.img.
|
||||
cdboot_img_SOURCES = boot/i386/pc/cdboot.S
|
||||
CLEANFILES += cdboot.img cdboot.exec cdboot_img-boot_i386_pc_cdboot.o
|
||||
MOSTLYCLEANFILES += cdboot_img-boot_i386_pc_cdboot.d
|
||||
|
||||
cdboot.img: cdboot.exec
|
||||
$(OBJCOPY) -O binary -R .note -R .comment $< $@
|
||||
|
||||
cdboot.exec: cdboot_img-boot_i386_pc_cdboot.o
|
||||
$(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(cdboot_img_LDFLAGS)
|
||||
|
||||
cdboot_img-boot_i386_pc_cdboot.o: boot/i386/pc/cdboot.S $(boot/i386/pc/cdboot.S_DEPENDENCIES)
|
||||
$(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(cdboot_img_ASFLAGS) -MD -c -o $@ $<
|
||||
-include cdboot_img-boot_i386_pc_cdboot.d
|
||||
|
||||
cdboot_img_ASFLAGS = $(COMMON_ASFLAGS)
|
||||
cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,7C00
|
||||
|
||||
# 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 \
|
||||
|
|
|
@ -11,7 +11,8 @@ normal/execute.c_DEPENDENCIES = grub_script.tab.h
|
|||
normal/command.c_DEPENDENCIES = grub_script.tab.h
|
||||
|
||||
# Images.
|
||||
pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img
|
||||
pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \
|
||||
cdboot.img
|
||||
|
||||
# For boot.img.
|
||||
boot_img_SOURCES = boot/i386/pc/boot.S
|
||||
|
@ -33,6 +34,11 @@ lnxboot_img_SOURCES = boot/i386/pc/lnxboot.S
|
|||
lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS)
|
||||
lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,6000
|
||||
|
||||
# For cdboot.img.
|
||||
cdboot_img_SOURCES = boot/i386/pc/cdboot.S
|
||||
cdboot_img_ASFLAGS = $(COMMON_ASFLAGS)
|
||||
cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,7C00
|
||||
|
||||
# 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 \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue