help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Trying to make a boot floppy with


From: Thomas \"Cakeisalie5\" Touhey
Subject: Trying to make a boot floppy with
Date: Sat, 26 Aug 2017 21:57:25 +0200 (CEST)

Hi! (sorry for the previous almost empty mail, my mail client was acting weird)

I would like to install grub2 on a floppy, with an embedded OS, in order to run 
a custom kernel from a friend (named Yggdrasil, weights 14.6 Ko), but couldn't 
manage to do this. The PC on which I'm trying to run this is a Thinkpad 750C 
from 1993 (no CD ROMs, only floppies), it's running on i486SL.

Here's my current script to try and prepare the floppy:

```
#!/bin/sh
# Make a blank 1440 KiB floppy
mkdir -p tmp
dd if=/dev/zero of=tmp/floppy.img bs=512 count=2880 status=none

# Setup the loopback device.
#losetup /dev/loop0 tmp/floppy.img
loop="$(udisksctl loop-setup -f tmp/floppy.img)"
loop="${loop#* as }"
loop="${loop%.}"

# Make an MS-DOS filesystem.
mkfs.fat -F 12 -n "YGGDRASIL" "$loop"
sync

# Mount it.
mnt=$(udisksctl mount -b "$loop")
mnt=${mnt#* at }
mnt=${mnt%.}

# Install grub.
modules='multiboot fat echo'
grub-install --target=i386-pc --allow-floppy --compress=no \
    --install-modules="$modules" --modules="$modules" \
    --themes= --locales= --fonts=ascii \
    --root-directory="$mnt" --boot-directory="$mnt" "$loop"

# Copy Yggdrasil and the grub configuration.
mkdir -p "$mnt/boot"
cp yggdrasil.bin "$mnt/boot/yggdrasil.bin"

# Unmount and delete the loopback device.
#umount root
udisksctl unmount -b "$loop"
#losetup -d /dev/loop0
udisksctl loop-delete -b "$loop"

# End of file.
```

And here is the grub.cfg I'm trying to embed in grub (I've been trying to just 
output "hello, world" for the last couple of tries):

```
echo "hello, world"
# multiboot /boot/yggdrasil.bin
# boot
```

Am I missing something? Do you know if this is possible, and how to solve this?

Thanks in advance!
Thomas "Cakeisalie5" Touhey


reply via email to

[Prev in Thread] Current Thread [Next in Thread]