Skip to content

Commit

Permalink
build: docs + website
Browse files Browse the repository at this point in the history
  • Loading branch information
d0p1s4m4 committed Mar 26, 2024
1 parent 0666a76 commit 4acbdad
Show file tree
Hide file tree
Showing 10 changed files with 119 additions and 175 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ bochsrc.bxrc
*.sys
*.obj
*.efi
*.EFI
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ run: all
-device ide-hd,drive=hdd \
-global isa-fdc.bootindexA=0 \
-serial mon:stdio

.PHONY: run-efi
run-efi: all OVMF32.fd
qemu-system-i386 \
Expand All @@ -79,6 +79,12 @@ run-efi: all OVMF32.fd
-device ide-hd,drive=hdd \
-serial stdio

.PHONY: docs
docs:
@mkdir -p docs/html
naturaldocs -p docs/config -img docs/img -xi sysroot -i . -ro -o HTML docs/html
cp docs/img/favicon.ico docs/html/

.PHONY: clean
clean: $(SUBDIRS)
$(RM) $(TARGET)
1 change: 1 addition & 0 deletions boot/bootsect/floppy.asm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
;; File: floppy.asm
format binary
use16

Expand Down
1 change: 1 addition & 0 deletions boot/efi/bootia32.asm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
; File: bootia32.asm
format PE DLL EFI at 10000000h
entry efimain

Expand Down
1 change: 1 addition & 0 deletions boot/loader/loader.asm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
;; File: loader.asm
format binary

include '../common/const.inc'
Expand Down
13 changes: 2 additions & 11 deletions docs/config/Languages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,5 @@ Format: 1.51

Alter Language: Assembly

Add Extensions: s inc
Struct Prototype Ender: endstruc


Language: PL/S

Extension: pls
Line Comment: //
Block Comment: /* */
Function Prototype Ender: ;
Variable Prototype Enders: ; =
Add Extensions: asm s inc
Struct Prototype Ender: }
115 changes: 22 additions & 93 deletions docs/config/Menu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ Format: 1.51


Title: StupidOS
SubTitle: Tiny *NIX-like Operating System
SubTitle: 32-bit Operating System written in x86 assembly.

Footer: Copyright (C) 2023 d0p1
Footer: Copyright (C) 2024 d0p1
Timestamp: Updated yyyy/mm/dd
# m - One or two digit month. January is "1"
# mm - Always two digit month. January is "01"
Expand Down Expand Up @@ -39,128 +39,57 @@ Timestamp: Updated yyyy/mm/dd


File: Introduction (docs/intro.txt)
Link: Source Code (https://github.com/d0p1s4m4/StupidOS)
Link: Source Code (https://git.cute.engineering/d0p1/StupidOS)
File: Coding Style (docs/coding-style.txt)
File: Building (building.txt)
File: FAQ (docs/faq.txt)

Group: Kernel {

File: Introduction (kernel/intro.txt)

Group: boot {

File: gdt.s (kernel/boot/gdt.s)
File: head.s (kernel/boot/head.s)
File: idt.s (kernel/boot/idt.s)
} # Group: boot

File: kernel.s (kernel/kernel.s)
File: pic.s (kernel/pic.s)

Group: dev {
Group: BootLoader {

Group: AT {
Group: BootSector {

File: IBM PC/AT (kernel/dev/at/intro.txt)
File: cmos.s (kernel/dev/at/cmos.s)
File: pit.s (kernel/dev/at/pit.s)
File: serial.s (kernel/dev/at/serial.s)
} # Group: AT
File: floppy.asm (boot/bootsect/floppy.asm)
} # Group: BootSector

} # Group: dev
Group: Loader {

Group: i18n {
File: loader.asm (boot/loader/loader.asm)
} # Group: Loader

File: msg_en.s (kernel/i18n/msg_en.s)
} # Group: i18n
Group: EFI {

File: pmm.s (kernel/pmm.s)
File: bootia32.asm (boot/efi/bootia32.asm)
} # Group: EFI

Group: sys {
} # Group: BootLoader

File: multiboot.inc (kernel/sys/multiboot.inc)

Group: i386 {

File: cpu.inc (kernel/sys/i386/cpu.inc)
File: cpuid.inc (kernel/sys/i386/cpuid.inc)
File: mmu.inc (kernel/sys/i386/mmu.inc)
File: registers.inc (kernel/sys/i386/registers.inc)
} # Group: i386

} # Group: sys
Group: Kernel {

File: vm.inc (kernel/vm/vm.inc)
File: pmap.s (kernel/vm/pmap.s)
File: kernel.asm (kernel/kernel.asm)
} # Group: Kernel

Group: Lib {

Group: Base {
Group: LZP {

File: base.inc (lib/base/base.inc)
File: log.s (lib/base/log.s)
} # Group: Base
File: lzp.asm (lib/lzp/lzp.asm)
} # Group: LZP

Group: Crypto {

Group: Hash {

File: sha256.s (lib/crypto/hash/sha256.s)
File: keccak.s (lib/crypto/hash/keccak.s)
} # Group: Hash

Group: Sign {
Group: SHA2 {

File: ecdsa.s (lib/crypto/sign/ecdsa.s)
} # Group: Sign
File: sha256.asm (lib/crypto/sha2/sha256.asm)
} # Group: SHA2

} # Group: Crypto

Group: PL/Stupid {

Group: Runtime {

File: crt0.s (lib/pls/runtime/crt0.s)
} # Group: Runtime

} # Group: PL/Stupid

} # Group: Lib

Group: Bin {

Group: motd {

File: main.pls (bin/motd/main.pls)
} # Group: motd

} # Group: Bin

Group: Share {

Group: Mk {

File: stupid.clean.mk (share/mk/stupid.clean.mk)
File: stupid.kernel.mk (share/mk/stupid.kernel.mk)
File: stupid.lib.mk (share/mk/stupid.lib.mk)
File: stupid.own.mk (share/mk/stupid.own.mk)
File: stupid.prog.mk (share/mk/stupid.prog.mk)
File: stupid.subdir.mk (share/mk/stupid.subdir.mk)
File: stupid.sys.mk (share/mk/stupid.sys.mk)
} # Group: Mk

} # Group: Share

Group: Index {

Index: Everything
Constant Index: Constants
File Index: Files
Function Index: Functions
Macro Index: Macros
Variable Index: Variables
Class Index: Classes
} # Group: Index

9 changes: 5 additions & 4 deletions kernel/kernel.asm
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
INCLUDE 'const.inc'
;; File: kernel.asm
include 'const.inc'

ORG KBASE
USE32
org KBASE
use32

jmp kmain

INCLUDE 'mm/mm.inc'
include 'mm/mm.inc'

kmain:
nop
Expand Down
53 changes: 23 additions & 30 deletions lib/crypto/sha2/sha256.asm
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
; file: sha256.s
; SHA-256 cryptographic hash
;
; Implementation is based on <Wikipedia's pseudocode at https://en.wikipedia.org/wiki/SHA-2#Pseudocode>
;
; About: CPU compatibility
; /!\ Only work on *486+* due to bswap for now.
;; File: sha256.asm
;; SHA-256 cryptographic hash

; Implementation is based on <Wikipedia's pseudocode at https://en.wikipedia.org/wiki/SHA-2#Pseudocode>
format COFF
use32

section '.data' data
; Constant: K
; SHA-256 round constants
; Constant: K
; SHA-256 round constants
K:
dd 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5
dd 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174
Expand All @@ -23,24 +20,22 @@ K:

section '.text' code

; Function: sha256_compute_block
;; Function: sha256_compute_block
sha256_compute_block:
push ebp
mov ebp, esp

leave
ret

; Function: sha256_internal
;
; in:
; - state
; - Input buffer
; - Input buffer size
;
; out:
; none
;
;; Function: sha256_internal
;;
;; Parameters:
;;
;; [esp+8] - state
;; [esp+12] - input buffer
;; [esp+16] - size of the input buffer
;;
sha256_internal:
push ebp
push edi
Expand Down Expand Up @@ -80,16 +75,14 @@ sha256_internal:
leave
ret

; Function: sha256
;
; in:
; - Output buffer
; - Input buffer
; - Input buffer size
;
; out:
; none
;
;; Function: sha256
;;
;; Parameters:
;;
;; [esp+8] - output buffer
;; [esp+12] - input buffer
;; [esp+16] - size of the input buffer
;;
public sha256
sha256:
push ebp
Expand Down
Loading

0 comments on commit 4acbdad

Please sign in to comment.