Limine Bare Bones: Difference between revisions

Change hdd creation instructions to allow for creation without sudo
[unchecked revision][unchecked revision]
mNo edit summary
(Change hdd creation instructions to allow for creation without sudo)
Line 409:
====Creating a hard disk/USB drive image====
 
In this example, we'll create a [[GPT]] partition table using '''partedsgdisk''', containing a single FAT partition, also known as the ESP in EFI terminology, which will store our kernel, configs, and bootloader.
 
This example is more involved and is made up of more steps than creating an ISO image.
Line 416:
 
<source lang="bash">
# Create an empty zeroed -out 64MiB image file.
dd if=/dev/zero bs=1M count=0 seek=64 of=image.hdd
 
# Create a GPT partition table.
parted -ssgdisk image.hdd mklabel-n 1:2048 -t gpt1:ef00
 
# Create an ESP partition that spans the whole disk.
parted -s image.hdd mkpart ESP fat32 2048s 100%
parted -s image.hdd set 1 esp on
 
# Download the latest Limine binary release.
Line 435 ⟶ 431:
./limine/limine bios-install image.hdd
 
# MountFormat the loopbackimage deviceas fat32.
USED_LOOPBACK=$(sudomformat losetup -Pf --showi image.hdd)@@1M
 
# Format the ESP partition as FAT32.
sudo mkfs.fat -F 32 ${USED_LOOPBACK}p1
 
# Mount the partition itself.
mkdir -p img_mount
sudo mount ${USED_LOOPBACK}p1 img_mount
 
# Make /EFI and /EFI/BOOT an MSDOS subdirectory.
# Copy the relevant files over.
sudo mkdirmmd -pi image.hdd@@1M ::/EFI img_mount::/EFI/BOOT
sudo cp -v myos.elf limine.cfg limine/limine-bios.sys img_mount/
sudo cp -v limine/BOOTX64.EFI img_mount/EFI/BOOT/
sudo cp -v limine/BOOTIA32.EFI img_mount/EFI/BOOT/
 
# Copy over the relevant files over.
# Sync system cache and unmount partition and loopback device.
sudo cpmcopy -vi image.hdd@@1M myos.elf limine.cfg limine/limine-bios.sys img_mount::/
sync
sudo cpmcopy -vi image.hdd@@1M limine/BOOTX64.EFI img_mount::/EFI/BOOT/
sudo umount img_mount
sudo cpmcopy -vi image.hdd@@1M limine/BOOTIA32.EFI img_mount::/EFI/BOOT/
sudo losetup -d ${USED_LOOPBACK}
</source>
 
Anonymous user