Rebranding
diff --git a/.gitignore b/.gitignore
index 0065763d..59833ad8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,5 @@
/bochsout.txt
/bx_enh_dbg.ini
.vscode
-!/qloader2.bin
+/limine-install
+!/limine.bin
diff --git a/CONFIG.md b/CONFIG.md
index d8b67969..529cdebf 100644
--- a/CONFIG.md
+++ b/CONFIG.md
@@ -1,6 +1,6 @@
-# qloader2 configuration file
+# Limine configuration file
-The qloader2 configuration file is comprised of *assignments* and *entries*.
+The Limine configuration file is comprised of *assignments* and *entries*.
*Entries* describe boot *entries* which the user can select in the *boot menu*.
diff --git a/Makefile b/Makefile
index f2bebc75..33d055d5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,18 @@
OS := $(shell uname)
+CC = cc
.PHONY: all clean echfs-test ext2-test test.img
all:
$(MAKE) -C src all
- cp src/qloader2.bin ./
+ cp src/limine.bin ./
clean:
$(MAKE) -C src clean
+limine-install: limine-install.c
+ $(CC) limine-install.c -o limine-install
+
test.img:
rm -f test.img
dd if=/dev/zero bs=1M count=0 seek=4096 of=test.img
@@ -26,8 +30,8 @@ echfs-test: test.img all
$(MAKE) -C test
echfs-utils -m -p0 test.img quick-format 32768
echfs-utils -m -p0 test.img import test/test.elf boot/test.elf
- echfs-utils -m -p0 test.img import test/qloader2.cfg qloader2.cfg
- ./qloader2-install src/qloader2.bin test.img
+ echfs-utils -m -p0 test.img import test/limine.cfg limine.cfg
+ ./limine-install src/limine.bin test.img
qemu-system-x86_64 -hda test.img -debugcon stdio
ext2-test: test.img all
@@ -40,12 +44,12 @@ ext2-test: test.img all
sudo mount `cat loopback_dev`p1 test_image
sudo mkdir test_image/boot
sudo cp test/test.elf test_image/boot/
- sudo cp test/qloader2.cfg test_image/
+ sudo cp test/limine.cfg test_image/
sync
sudo umount test_image/
sudo losetup -d `cat loopback_dev`
rm -rf test_image loopback_dev
- ./qloader2-install src/qloader2.bin test.img
+ ./limine-install src/limine.bin test.img
qemu-system-x86_64 -hda test.img -debugcon stdio
fat32-test: test.img all
@@ -64,7 +68,7 @@ else ifeq ($(OS), FreeBSD)
endif
sudo mkdir test_image/boot
sudo cp test/test.elf test_image/boot/
- sudo cp test/qloader2.cfg test_image/
+ sudo cp test/limine.cfg test_image/
sync
sudo umount test_image/
ifeq ($(OS), Linux)
@@ -73,5 +77,5 @@ else ifeq ($(OS), FreeBSD)
sudo mdconfig -d -u md9
endif
rm -rf test_image loopback_dev
- ./qloader2-install src/qloader2.bin test.img
+ ./limine-install src/limine.bin test.img
qemu-system-x86_64 -hda test.img -debugcon stdio
diff --git a/README.md b/README.md
index ec2c8537..dad4d225 100644
--- a/README.md
+++ b/README.md
@@ -1,11 +1,11 @@
-# qloader2
+# Limine
x86/x86_64 BIOS Bootloader

### Supported boot protocols
* Linux
-* stivale and stivale2 (qloader2's native boot protocols, see STIVALE{,2}.md for details)
+* stivale and stivale2 (Limine's native boot protocols, see STIVALE{,2}.md for details)
### Supported filesystems
* ext2
@@ -17,14 +17,13 @@ x86/x86_64 BIOS Bootloader
* GPT
## How to use
-This repository contains a prebuilt version of qloader2 so building it won't
-be necessary.
+This repository contains a prebuilt version of Limine so building it won't be necessary.
-In order to install qloader2 on a MBR device (which can just be a raw image file),
-run the provided `qloader2-install` script as such:
+In order to install Limine on a MBR device (which can just be a raw image file), build the
+`limine-install` program using `make limine-install`, then run the resulting executable as such:
```bash
-./qloader2-install ./qloader2.bin <path to device/image>
+./limine-install ./limine.bin <path to device/image>
```
If using a GPT formatted device, it will be necessary to create an extra partition
@@ -33,20 +32,20 @@ the install script where this partition is located by specifying the start secto
```bash
fdisk <device> # Create bootloader partition using your favourite method
-./qloader2-install ./qloader2.bin <path to device/image> <start sector of boot partition>
+./limine-install ./limine.bin <path to device/image> <start sector of boot partition>
```
Then make sure the device/image contains at least 1 partition formatted in
-a supported filesystem containing a `/qloader2.cfg` or `/boot/qloader2.cfg` file
+a supported filesystem containing a `/limine.cfg` or `/boot/limine.cfg` file
and the kernel/modules one wants to load.
-An example `qloader2.cfg` file can be found in `test/qloader2.cfg`.
+An example `limine.cfg` file can be found in `test/limine.cfg`.
-More info on the format of `qloader2.cfg` can be found in `CONFIG.md`.
+More info on the format of `limine.cfg` can be found in `CONFIG.md`.
For example, to create an empty image file of 64MiB in size, 1 echfs partition
on the image spanning the whole device, format it, copy the relevant files over,
-and install qloader2, one can do:
+and install Limine, one can do:
```bash
dd if=/dev/zero bs=1M count=0 seek=64 of=test.img
@@ -55,18 +54,18 @@ parted -s test.img mkpart primary 1 100%
parted -s test.img set 1 boot on # Workaround for buggy BIOSes
echfs-utils -m -p0 test.img quick-format 32768
-echfs-utils -m -p0 test.img import path/to/qloader2.cfg qloader2.cfg
+echfs-utils -m -p0 test.img import path/to/limine.cfg limine.cfg
echfs-utils -m -p0 test.img import path/to/kernel.elf kernel.elf
echfs-utils -m -p0 test.img import <path to file> <path in image>
...
-./qloader2-install $THIS_REPO/qloader2.bin test.img
+./limine-install $THIS_REPO/limine.bin test.img
```
One can get `echfs-utils` by installing https://github.com/qword-os/echfs.
## Building from source
-In order to hack qloader2, one must build the GCC toolchain from source first.
+In order to hack Limine, one must build the GCC toolchain from source first.
To do so, run the `make_toolchain.sh` script from within the `toolchain` directory;
keep in mind that the script takes `MAKEFLAGS` as an argument.
@@ -77,7 +76,7 @@ cd toolchain
```
After that is done, simply run `make` in the root of the repo to generate
-`src/qloader2.bin`.
+`limine.bin`.
## Discord server
We have a Discord server if you need support, info, or you just want to
diff --git a/qloader2-install.c b/limine-install.c
similarity index 92%
rename from qloader2-install.c
rename to limine-install.c
index 98d7af39..6afd3187 100644
--- a/qloader2-install.c
+++ b/limine-install.c
@@ -6,7 +6,7 @@
int main(int argc, char *argv[]) {
if (argc < 3) {
- printf("Usage: %s <path to qloader2 binary> <device> [stage2 start sector]\n", argv[0]);
+ printf("Usage: %s <path to bootloader binary> <device> [stage2 start sector]\n", argv[0]);
return 1;
}
diff --git a/qloader2.bin b/limine.bin
similarity index 65%
rename from qloader2.bin
rename to limine.bin
index db2355a5..6b707945 100644
Binary files a/qloader2.bin and b/limine.bin differ
diff --git a/qloader2-install b/qloader2-install
deleted file mode 100755
index c585c7fe..00000000
--- a/qloader2-install
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ -z "$2" ]; then
- echo "Usage: $0 <path to qloader2 binary> <device> [stage2 start sector]"
- exit 1
-fi
-
-# Variables.
-DEVICE="$2"
-MBR="$(mktemp)"
-BINARY_SECT_SRC="$(mktemp)"
-BINARY_SECT_BIN="$(mktemp)"
-QLOADER2="$1"
-
-if [ -z "$3" ]; then
- STAGE2_SECT=1
-else
- STAGE2_SECT="$3"
-fi
-
-echo "dd $STAGE2_SECT" > "$BINARY_SECT_SRC"
-nasm "$BINARY_SECT_SRC" -f bin -o "$BINARY_SECT_BIN"
-
-# Copy the loader to the device.
-dd if="$DEVICE" of="$MBR" bs=1 count=64 skip=446 2>/dev/null
-dd if="$QLOADER2" of="$DEVICE" bs=512 count=1 conv=notrunc 2>/dev/null
-dd if="$QLOADER2" of="$DEVICE" bs=512 count=63 skip=1 seek=$(( $STAGE2_SECT )) conv=notrunc 2>/dev/null
-dd if="$BINARY_SECT_BIN" of="$DEVICE" bs=1 count=4 seek=$(( 0x1b0 )) conv=notrunc 2>/dev/null
-dd if="$MBR" of="$DEVICE" bs=1 count=64 seek=446 conv=notrunc 2>/dev/null
-
-rm "$MBR" "$BINARY_SECT_SRC" "$BINARY_SECT_BIN"
diff --git a/screenshot.png b/screenshot.png
index 4dbe73fc..debe18ba 100644
Binary files a/screenshot.png and b/screenshot.png differ
diff --git a/src/Makefile b/src/Makefile
index fdbb2ec2..27e1c32f 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -29,11 +29,11 @@ INTERNAL_LDFLAGS = \
C_FILES := $(shell find ./ -type f -name '*.c' | sort)
OBJ := $(C_FILES:.c=.o)
-all: qloader2.bin
+all: limine.bin
-qloader2.bin: $(OBJ)
+limine.bin: $(OBJ)
$(LD) $(OBJ) $(LDFLAGS) $(INTERNAL_LDFLAGS) -o stage2.bin
- cd bootsect && nasm bootsect.asm -fbin -o ../qloader2.bin
+ cd bootsect && nasm bootsect.asm -fbin -o ../limine.bin
%.o: %.c
$(CC) $(CFLAGS) $(INTERNAL_CFLAGS) -c $< -o $@
diff --git a/src/bootsect/bootsect.asm b/src/bootsect/bootsect.asm
index 4bd3cd7d..582c428f 100644
--- a/src/bootsect/bootsect.asm
+++ b/src/bootsect/bootsect.asm
@@ -17,11 +17,11 @@ start:
mov ss, ax
mov sp, 0x7c00
sti
-
+
; Some BIOSes don't pass the correct boot drive number,
; so we need to do the job
.check_drive:
- ; Qloader2 isn't made for floppy disks, these are dead anyways.
+ ; Limine isn't made for floppy disks, these are dead anyways.
; So if the value the BIOS passed is <0x80, just assume it has passed
; an incorrect value
test dl, 0x80
@@ -34,7 +34,7 @@ start:
.fix_drive:
; Try to fix up the mess the BIOS have done
mov dl, 0x80
-
+
.continue:
mov si, LoadingMsg
call simple_print
@@ -72,7 +72,7 @@ halt:
; Data
-LoadingMsg db 0x0D, 0x0A, '<ql2>', 0x0D, 0x0A, 0x0A, 0x00
+LoadingMsg db 0x0D, 0x0A, 'Limine', 0x0D, 0x0A, 0x0A, 0x00
Stage2Msg db 'Loading stage2...', 0x00
ErrReadDiskMsg db 0x0D, 0x0A, 'Disk read error, system halted', 0x00
ErrEnableA20Msg db 0x0D, 0x0A, 'A20 enable error, system halted', 0x00
diff --git a/src/lib/config.c b/src/lib/config.c
index e26139fc..5486d058 100644
--- a/src/lib/config.c
+++ b/src/lib/config.c
@@ -11,8 +11,8 @@ static char *config_addr;
int init_config(int drive, int part) {
struct file_handle f;
- if (fopen(&f, drive, part, "/qloader2.cfg")) {
- if (fopen(&f, drive, part, "/boot/qloader2.cfg")) {
+ if (fopen(&f, drive, part, "/limine.cfg")) {
+ if (fopen(&f, drive, part, "/boot/limine.cfg")) {
return -1;
}
}
diff --git a/src/limine.h b/src/limine.h
new file mode 100644
index 00000000..6f9e2c11
--- /dev/null
+++ b/src/limine.h
@@ -0,0 +1,6 @@
+#ifndef __LIMINE_H__
+#define __LIMINE_H__
+
+#define LIMINE_VERSION "0.4"
+
+#endif
diff --git a/src/main.c b/src/main.c
index ea2e2d1f..480ba396 100644
--- a/src/main.c
+++ b/src/main.c
@@ -13,7 +13,7 @@ ASM_BASIC(
"jmp main\n\t"
);
-#include <qloader2.h>
+#include <limine.h>
#include <drivers/vga_textmode.h>
#include <lib/real.h>
#include <lib/blib.h>
@@ -35,7 +35,7 @@ void main(int boot_drive) {
// Initial prompt.
init_vga_textmode();
- print("qloader2 " QLOADER2_VERSION "\n\n");
+ print("Limine " LIMINE_VERSION "\n\n");
print("Boot drive: %x\n", boot_drive);
diff --git a/src/menu.c b/src/menu.c
index 5ee2a762..8766c147 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1,7 +1,7 @@
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
-#include <qloader2.h>
+#include <limine.h>
#include <menu.h>
#include <lib/print.h>
#include <lib/blib.h>
@@ -32,7 +32,7 @@ char *menu(void) {
refresh:
text_clear();
- print("\n\n \e[44m qloader\e[33m2\e[37m " QLOADER2_VERSION " \e[40m\n\n\n");
+ print("\n\n \e[36m Limine " LIMINE_VERSION " \e[37m\n\n\n");
print("Select an entry:\n\n");
diff --git a/src/protos/stivale2.c b/src/protos/stivale2.c
index bfa59fd8..a5bef8ec 100644
--- a/src/protos/stivale2.c
+++ b/src/protos/stivale2.c
@@ -1,7 +1,7 @@
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
-#include <qloader2.h>
+#include <limine.h>
#include <protos/stivale2.h>
#include <lib/elf.h>
#include <lib/blib.h>
@@ -247,8 +247,8 @@ void stivale2_load(char *cmdline, int boot_drive) {
print("stivale2: Top used address in ELF: %X\n", top_used_addr);
- strcpy(stivale2_struct.bootloader_brand, "qloader2");
- strcpy(stivale2_struct.bootloader_version, QLOADER2_VERSION);
+ strcpy(stivale2_struct.bootloader_brand, "Limine");
+ strcpy(stivale2_struct.bootloader_version, LIMINE_VERSION);
//////////////////////////////////////////////
// Create firmware struct tag
diff --git a/src/qloader2.h b/src/qloader2.h
deleted file mode 100644
index c4a02ae7..00000000
--- a/src/qloader2.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __QLOADER2_H__
-#define __QLOADER2_H__
-
-#define QLOADER2_VERSION "0.4"
-
-#endif
diff --git a/test/limine.cfg b/test/limine.cfg
new file mode 100644
index 00000000..2492b4d2
--- /dev/null
+++ b/test/limine.cfg
@@ -0,0 +1,9 @@
+TIMEOUT=3
+
+:MyOS
+
+PROTOCOL=stivale2
+
+KERNEL_PARTITION=0
+KERNEL_PATH=boot/test.elf
+KERNEL_CMDLINE=something
diff --git a/test/qloader2.cfg b/test/qloader2.cfg
deleted file mode 100644
index 00e0a846..00000000
--- a/test/qloader2.cfg
+++ /dev/null
@@ -1,24 +0,0 @@
-TIMEOUT=3
-
-:Test kernel
-
-PROTOCOL=stivale2
-
-KERNEL_PARTITION=0
-KERNEL_PATH=boot/test.elf
-KERNEL_CMDLINE=something
-
-MODULE_PARTITION=0
-MODULE_PATH=qloader2.cfg
-MODULE_STRING=something here
-
-:Test 2
-
-KERNEL_PARTITION=0
-KERNEL_PATH=/boot/test.elf
-KERNEL_PROTO=stivale
-KERNEL_CMDLINE=none
-
-MODULE_PARTITION=0
-MODULE_PATH=qloader2.cfg
-MODULE_STRING=something here
