diff --git a/boot/grub/create_disk.sh b/boot/grub/create_disk.sh new file mode 100755 index 0000000..3d7a058 --- /dev/null +++ b/boot/grub/create_disk.sh @@ -0,0 +1,50 @@ +#=----------------------------------------------------------------------------=# +# GNU GPL OS/K # +# # +# Desc: OS/K image maker script # +# # +# # +# Copyright © 2018-2019 The OS/K Team # +# # +# This file is part of OS/K. # +# # +# OS/K is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# any later version. # +# # +# OS/K is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY# without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with OS/K. If not, see . # +#=----------------------------------------------------------------------------=# + +## Create the image +dd if=/dev/zero of=disk.img bs=512 count=131072 + +## Partition the image +# WARNING, DO NOT DELETE SPACES ! +fdisk disk.img <. # +#=----------------------------------------------------------------------------=# + +## Prepare Mount +sudo losetup -D +sudo losetup /dev/loop0 disk.img # mounting the device block +sudo losetup /dev/loop1 disk.img -o 1048576 #mounting the logical partition + +## Mount +sudo mount /dev/loop1 ./disk +## Install grub +sudo grub-install --target=i386-pc --debug --root-directory=./disk --boot-directory=./disk/boot --no-floppy --modules="part_msdos biosdisk fat multiboot configfile" /dev/loop0 +sudo cp ./grub.cfg ./disk/boot/grub/grub.cfg +sync + +sudo umount /dev/loop1 +sudo losetup -D + diff --git a/boot/grub/grub.cfg b/boot/grub/grub.cfg new file mode 100755 index 0000000..878c1b8 --- /dev/null +++ b/boot/grub/grub.cfg @@ -0,0 +1,32 @@ +#=----------------------------------------------------------------------------=# +# GNU GPL OS/K # +# # +# Desc: Grub 2 configuration file for OS/K boot # +# # +# # +# Copyright © 2018-2019 The OS/K Team # +# # +# This file is part of OS/K. # +# # +# OS/K is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# any later version. # +# # +# OS/K is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY# without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with OS/K. If not, see . # +#=----------------------------------------------------------------------------=# + +set timeout=5 + +set default=0 #Set the default menu entry + +menuentry "OS/K (pre-pre-alpha 0.0.1)" { + multiboot /boot/loader.bin # The multiboot command replaces the kernel command + boot +} diff --git a/boot/grub/mount.sh b/boot/grub/mount.sh new file mode 100755 index 0000000..4918d59 --- /dev/null +++ b/boot/grub/mount.sh @@ -0,0 +1,27 @@ +#=----------------------------------------------------------------------------=# +# GNU GPL OS/K # +# # +# Desc: Simple OS/K image mount script # +# # +# # +# Copyright © 2018-2019 The OS/K Team # +# # +# This file is part of OS/K. # +# # +# OS/K is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# any later version. # +# # +# OS/K is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY# without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with OS/K. If not, see . # +#=----------------------------------------------------------------------------=# + +sudo losetup -D +sudo losetup /dev/loop0 disk.img -o 1048576 #mounting the logical partition +sudo mount -t vfat /dev/loop0 ./disk -o rw,uid=$(id -u),gid=$(id -g) diff --git a/boot/grub/multiboot.pdf b/boot/grub/multiboot.pdf new file mode 100644 index 0000000..e32056f Binary files /dev/null and b/boot/grub/multiboot.pdf differ diff --git a/boot/grub/umount.sh b/boot/grub/umount.sh new file mode 100755 index 0000000..6bd768f --- /dev/null +++ b/boot/grub/umount.sh @@ -0,0 +1,26 @@ +#=----------------------------------------------------------------------------=# +# GNU GPL OS/K # +# # +# Desc: Simple unmount script # +# # +# # +# Copyright © 2018-2019 The OS/K Team # +# # +# This file is part of OS/K. # +# # +# OS/K is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# any later version. # +# # +# OS/K is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY# without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with OS/K. If not, see . # +#=----------------------------------------------------------------------------=# + +sudo umount ./disk +sudo losetup -D