docs: minor change

This commit is contained in:
d0p1 🏳️‍⚧️ 2024-07-05 08:16:40 +02:00
parent c97a637ecd
commit 2d48606692
11 changed files with 256 additions and 182 deletions

View file

@ -1,16 +1,23 @@
;; File: bootinfo.inc
;; Struct: BootInfoRange
struc BootInfoRange {
.base dd ?
.legth dd ?
}
;; Struct: BootInfo
;;
;; StupidOS boot protocol structure
struc BootInfo {
.mmap dd 4*2*40 dup(0)
.kernel_start dd ?
.kernel_size dd ?
}
;; Section: Globals
;; Constant: BOOTINFO_MEMORY_LIMIT
BOOTINFO_MEMORY_LIMIT = 0xFFFFF000

View file

@ -1,12 +1,6 @@
;; File: fat12.inc
ATTR_READ_ONLY = 0x01
ATTR_HIDDEN = 0x02
ATTR_SYSTEM = 0x04
ATTR_VOLUME_ID = 0x08
ATTR_DIRECTORY = 0x10
ATTR_ARCHIVE = 0x20
;; Struct: fat_entry
struc fat_entry
{
.name db 8 dup ?
@ -24,6 +18,22 @@ struc fat_entry
}
defn fat_entry
;; Constants: Attributes
;; ATTR_READ_ONLY - Read-only
;; ATTR_HIDDEN - Hidden
;; ATTR_SYSTEM - System
;; ATTR_VOLUME_ID - Volume label
;; ATTR_DIRECTORY - Subdirectory
;; ATTR_ARCHIVE - Archive
ATTR_READ_ONLY = 0x01
ATTR_HIDDEN = 0x02
ATTR_SYSTEM = 0x04
ATTR_VOLUME_ID = 0x08
ATTR_DIRECTORY = 0x10
ATTR_ARCHIVE = 0x20
;; Section: Globals
;; Function: fat_load_root
fat_load_root:
mov ax, DISK_BUFFER/0x10

View file

@ -1,3 +1,6 @@
;; File: macro.inc
;; Macro: defn name
macro defn name
{
virtual at 0

View file

@ -1,6 +1,8 @@
; copy/pasted from https://wiki.osdev.org/A20_Line
; .... sorry I was lazy :x
;; File: a20.inc
;; copy/pasted from https://wiki.osdev.org/A20_Line
;; .... sorry I was lazy :x
;; Function: a20_get_state
a20_get_state:
pushf
push si
@ -47,7 +49,7 @@ a20_get_state:
.BufferBelowMB: db 0
.BufferOverMB db 0
;; Function: a20_query_support
a20_query_support:
push bx
clc
@ -67,6 +69,7 @@ a20_query_support:
pop bx
ret
;; Function: a20_enable_keyboard_controller
a20_enable_keyboard_controller:
cli
@ -109,8 +112,11 @@ a20_enable_keyboard_controller:
jz .wait_io2
ret
; out:
; cf - set on error
;; Function: a20_enable
;;
;; Out:
;; CF - set on error
;;
a20_enable:
clc ; clear cf
pusha

View file

@ -14,6 +14,8 @@
multiboot_header:
mb_header MultibootHeader multiboot_header
;; Function: _start
;; Loader entry point.
_start:
cmp eax, MULTIBOOT_MAGIC
je multiboot

View file

@ -56,6 +56,7 @@ struc VesaModeInfo
.Reserved2 db 206 dup(?)
}
;; Function: video_setup
video_setup:
mov si, szMsgDetectVideo
call bios_log

View file

@ -11,4 +11,9 @@ fi
DESTDIR=${BUILDDIR}/iso
mkdir -p "${OBJ}"
(cd "${OBJ}"; get_grub)
make

View file

@ -10,5 +10,15 @@ fi
. ./releasetools/image.functions
DESTDIR=${BUILDDIR}/floppy
export DESTDIR
mkdir -p "${BUILDDIR}" "${OBJ}"
mkdir -p "${DESTDIR}/boot"
create_stpdboot_ini "${DESTDIR}/boot"
make
echo ""
echo "floppy image at $(pwd)/${IMG}"

View file

@ -11,10 +11,21 @@ fi
. ./releasetools/image.defaults
. ./releasetools/image.functions
DESTDIR=${BUILDDIR}/hd
export DESTDIR
if [ -f "${IMG}" ]
then
rm -f "${IMG}"
fi
mkdir -p "${BUILDDIR}" "${OBJ}"
mkdir -p "${DESTDIR}/boot"
create_stpdboot_ini "${DESTDIR}/boot"
make
echo ""
echo "Disk image at $(pwd)/${IMG}"

View file

@ -1,5 +1,6 @@
#!/usr/bin/env bash
: "${BUILDDIR=.build}"
: "${BUILDDIR=$(pwd)/.build}"
: "${OBJ=${BUILDDIR}/obj}"
: "${DESTDIR=${BUILDDIR}/dist}"
: "${TOOLSDIR=$(pwd)/.tools}"

View file

@ -19,12 +19,18 @@ menuentry "StupidOS" {
EOF
)"
echo "$grub_cfg" > "$target"
echo "$grub_cfg" > "${target}/grub.cfg"
}
get_grub()
{
echo
local version="2.12"
local url="https://ftp.gnu.org/gnu/grub/grub-${version}.tar.gz"
wget "${url}"
tar -xvf "grub-${version}.tar.gz"
(cd "grub-${version}"; ./configure --prefix="${TOOLSDIR}" && make install)
}
create_efi_image()
@ -32,3 +38,15 @@ create_efi_image()
echo
}
create_stpdboot_ini()
{
local target="$1"
local stupid_ini="$(cat <<EOF
CMDLINE=consdev=com0
MODULE=dummy.mod
MODULE=dummy2.mod
EOF
)"
echo "$stupid_ini" > "${target}/stupid.ini"
}