Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
wfeldt committed Mar 26, 2009
1 parent 1305eb6 commit 0be2057
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 6 deletions.
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,26 @@ test:
sw 0 ./bdr --create-map --add-to-mbr test.img /mnt/boot.img
umnt

test_dos:
./setup_img_dos test_dos.img 50M 100M
mnt test_dos.img
sw 0 ./bdr --create-map --geo 4,16 --bios 0x80 --add-to-mbr test_dos.img /mnt/boot.img
umnt

test_grub:
./setup_img test_grub.img 50M 100M
mnt test_grub.img
sw 0 ./bdr --create-map --add-to-mbr test_grub.img /mnt/boot.img
sw 0 ./bdr --create-map --geo 4,16 --bios 0x80 --add-to-mbr test_grub.img /mnt/boot.img
./setup_grub /mnt/boot.img
umnt

test_grub2:
./setup_img test_grub2.img 50M 100M
mnt test_grub2.img
sw 0 ./bdr --create-map --geo 4,16 --bios 0x83 --add-to-mbr test_grub2.img /mnt/boot.img
./setup_grub /mnt/boot.img 3
umnt

test_01: test_01.bin
./setup_img test_01.img 50M 100M
mnt test_01.img
Expand Down
9 changes: 9 additions & 0 deletions dos/README.FreeDOS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
kernel.sys FreeDOS kernel
command.com FreeDOS command line interpreter
freedos_boot.fat12 FreeDOS boot block for FAT12
freedos_boot.fat16 FreeDOS boot block for FAT16

FreeDOS files have been taken from the FreeDOS binary distribution that
comes with dosemu-1.4.0 (http://www.dosemu.org).

FreeDOS is licensed under GPL, see COPYING.FreeDOS for details.
Empty file added dos/autoexec.bat
Empty file.
Binary file added dos/command.com
Binary file not shown.
Empty file added dos/config.sys
Empty file.
Binary file added dos/freedos_boot.fat12
Binary file not shown.
Binary file added dos/freedos_boot.fat16
Binary file not shown.
Binary file added dos/kernel.sys
Binary file not shown.
Binary file added dos/mbr
Binary file not shown.
16 changes: 11 additions & 5 deletions setup_grub
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#! /bin/bash

file=$1
drive=$2

if [ -z "$file" ] ; then
echo "usage: setup_grub image_file"
exit 1
fi

if [ -z "$drive" ] ; then
drive=0
fi

mnt $file
sw 0 mkdir -p /mnt/boot/grub
sw 0 cp /usr/lib/grub/{fat_stage1_5,stage1,stage2} /mnt/boot/grub
Expand All @@ -15,20 +20,21 @@ sw 0 cp /boot/vmlinuz /boot/initrd /boot/message /mnt/boot
sw 0 sh -c 'cat >/mnt/boot/grub/menu.lst' <<zap
default 0
timeout 20
gfxmenu (hd0,0)/boot/message
gfxmenu (hd${drive},0)/boot/message
title Test 1
root (hd0,0)
root (hd${drive},0)
kernel /boot/vmlinuz vga=0x314 splash=silent showopts
initrd /boot/initrd
title Test 2
root (hd0,0)
root (hd${drive},0)
kernel /boot/vmlinuz vga=0x314 splash=silent showopts
initrd /boot/initrd
zap

umnt

echo -e "device (hd0) /mnt/boot.img\nsetup --prefix=/boot/grub (hd0) (hd0,0)" | sw 0 grub --batch

echo "(hd0) /dev/null" >setup_grub.tmp
echo -e "device (hd${drive}) /mnt/boot.img\nsetup --prefix=/boot/grub (hd${drive}) (hd${drive},0)" | sw 0 grub --batch --device-map=setup_grub.tmp --no-config-file
rm -f setup_grub.tmp
30 changes: 30 additions & 0 deletions setup_img_dos
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#! /bin/bash

file=$1
start=$2
size=$3

if [ -z "$size" ] ; then
echo "usage: setup_img file start size [mbr]"
exit 1
fi

if [ -n "$start" ] ; then
start="--part-ofs $start"
fi

umnt
./hdimage --verbose $start --size $size --chs 0 7 19 --mkfs xfs $file
mnt $file
sw 0 chmod 777 /mnt
./hdimage --verbose\
--type 1\
--size 10M\
--chs 0 4 16\
--mkfs fat\
--mbr dos/mbr\
--boot-fat12 dos/freedos_boot.fat12\
--boot-fat16 dos/freedos_boot.fat16\
--add-files dos/kernel.sys dos/command.com dos/autoexec.bat dos/config.sys\
-- /mnt/boot.img
umnt

0 comments on commit 0be2057

Please sign in to comment.