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 ;; File: bootinfo.inc
;; Struct: BootInfoRange
struc BootInfoRange { struc BootInfoRange {
.base dd ? .base dd ?
.legth dd ? .legth dd ?
} }
;; Struct: BootInfo
;;
;; StupidOS boot protocol structure
struc BootInfo { struc BootInfo {
.mmap dd 4*2*40 dup(0) .mmap dd 4*2*40 dup(0)
.kernel_start dd ? .kernel_start dd ?
.kernel_size dd ? .kernel_size dd ?
} }
;; Section: Globals
;; Constant: BOOTINFO_MEMORY_LIMIT
BOOTINFO_MEMORY_LIMIT = 0xFFFFF000 BOOTINFO_MEMORY_LIMIT = 0xFFFFF000

View file

@ -1,12 +1,6 @@
;; File: fat12.inc ;; File: fat12.inc
ATTR_READ_ONLY = 0x01 ;; Struct: fat_entry
ATTR_HIDDEN = 0x02
ATTR_SYSTEM = 0x04
ATTR_VOLUME_ID = 0x08
ATTR_DIRECTORY = 0x10
ATTR_ARCHIVE = 0x20
struc fat_entry struc fat_entry
{ {
.name db 8 dup ? .name db 8 dup ?
@ -24,6 +18,22 @@ struc fat_entry
} }
defn 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 ;; Function: fat_load_root
fat_load_root: fat_load_root:
mov ax, DISK_BUFFER/0x10 mov ax, DISK_BUFFER/0x10

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -10,5 +10,15 @@ fi
. ./releasetools/image.functions . ./releasetools/image.functions
DESTDIR=${BUILDDIR}/floppy DESTDIR=${BUILDDIR}/floppy
export DESTDIR 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.defaults
. ./releasetools/image.functions . ./releasetools/image.functions
DESTDIR=${BUILDDIR}/hd
export DESTDIR
if [ -f "${IMG}" ] if [ -f "${IMG}" ]
then then
rm -f "${IMG}" rm -f "${IMG}"
fi fi
mkdir -p "${BUILDDIR}" "${OBJ}"
mkdir -p "${DESTDIR}/boot"
create_stpdboot_ini "${DESTDIR}/boot"
make
echo "" echo ""
echo "Disk image at $(pwd)/${IMG}" echo "Disk image at $(pwd)/${IMG}"

View file

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

View file

@ -19,12 +19,18 @@ menuentry "StupidOS" {
EOF EOF
)" )"
echo "$grub_cfg" > "$target" echo "$grub_cfg" > "${target}/grub.cfg"
} }
get_grub() 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() create_efi_image()
@ -32,3 +38,15 @@ create_efi_image()
echo 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"
}