summaryrefslogtreecommitdiffhomepage
path: root/src/amd64
diff options
context:
space:
mode:
authorAmlal <amlal.elmahrouss@icloud.com>2025-01-21 20:32:19 +0100
committerAmlal <amlal.elmahrouss@icloud.com>2025-01-21 20:32:19 +0100
commit046d884b50c32cacd3523071541e7e38241083f3 (patch)
tree92ce6fd53e0c031c569270b04aefa8fc0aa1e074 /src/amd64
ADD: CoreBoot, also comes with my reimplementation of libfdt, which is just a dumb rewrite.
Signed-off-by: Amlal <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'src/amd64')
-rw-r--r--src/amd64/amd64-boot.asm40
-rw-r--r--src/amd64/amd64-test.asm19
-rwxr-xr-xsrc/amd64/amd64.sh4
3 files changed, 63 insertions, 0 deletions
diff --git a/src/amd64/amd64-boot.asm b/src/amd64/amd64-boot.asm
new file mode 100644
index 0000000..bcd6058
--- /dev/null
+++ b/src/amd64/amd64-boot.asm
@@ -0,0 +1,40 @@
+;; AMD64 CoreBoot Master Boot Program.
+;; Written by Amlal EL Mahrouss
+
+%define ENTRYPOINT 0x00FF
+
+[bits 16]
+[org ENTRYPOINT]
+
+amd64_bios_start:
+ cli
+ cld
+
+ mov ax, cs
+ mov ds, ax
+ mov es, ax
+ mov ss, ax
+ mov fs, ax
+
+ jmp amd64_bios_programmable_area
+ jmp 0x0000:0x7c00
+ jmp $
+
+amd64_vendor_information:
+ db "ZKA", 0
+ dw 0x010
+amd64_vendor_information_end:
+
+amd64_bios_programmable_area:
+ times 1024 nop
+ ret
+amd64_bios_programmable_area_end:
+
+times 2048-13-($-$$) nop
+
+;; SIZE: 13 Bytes.
+;; PURPOSE: BIOS Computer Metadata
+amd64_bios_entrypoint_area:
+ dw ENTRYPOINT ;; ENTRYPOINT.
+ db "13/21/2024" ;; DATE.
+ db 0x01 ;; VERSION.
diff --git a/src/amd64/amd64-test.asm b/src/amd64/amd64-test.asm
new file mode 100644
index 0000000..2a8bef8
--- /dev/null
+++ b/src/amd64/amd64-test.asm
@@ -0,0 +1,19 @@
+;; AMD64 CoreBoot Sample program.
+;; Written by Amlal EL Mahrouss
+
+[bits 16]
+[org 0x7c00]
+
+; --------------
+; Main entrypoint, just loop.
+; --------------
+amd64_main:
+ jmp $
+ cli
+ hlt
+
+times 512-6-2-2-($-$$) nop
+
+db "BOOT1", 0 ;; Payload
+dw 0x0100 ;; Version 1
+dw 0 ;; Binary Blob
diff --git a/src/amd64/amd64.sh b/src/amd64/amd64.sh
new file mode 100755
index 0000000..ea9efa0
--- /dev/null
+++ b/src/amd64/amd64.sh
@@ -0,0 +1,4 @@
+#! /bin/sh
+
+nasm amd64-boot.asm -f bin -o amd64-boot.rom
+nasm amd64-test.asm -f bin -o amd64-test.bin