refactor: remove duplicate macro.inc
This commit is contained in:
parent
b2178714f7
commit
34025f7766
14 changed files with 46 additions and 21 deletions
|
|
@ -3,7 +3,7 @@
|
|||
use16
|
||||
|
||||
include '../common/const.inc'
|
||||
include '../common/macro.inc'
|
||||
include 'sys/macro.inc'
|
||||
|
||||
org BOOTSECT_BASE
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
use16
|
||||
|
||||
include '../common/const.inc'
|
||||
include '../common/macro.inc'
|
||||
include 'sys/macro.inc'
|
||||
|
||||
jmp short _start
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
use16
|
||||
|
||||
include '../common/const.inc'
|
||||
include '../common/macro.inc'
|
||||
include 'sys/macro.inc'
|
||||
include '../common/bios.inc'
|
||||
include '../common/mbr.inc'
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
;; File: bootinfo.inc
|
||||
|
||||
include '../../kernel/sys/bootinfo.inc'
|
||||
include 'sys/bootinfo.inc'
|
||||
|
||||
;; Constant: BOOTINFO_MEMORY_LIMIT
|
||||
BOOTINFO_MEMORY_LIMIT = 0xFFFFF000
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
;; File: macro.inc
|
||||
|
||||
;; Macro: DEFN name
|
||||
macro DEFN x {
|
||||
virtual at 0
|
||||
x x
|
||||
sizeof.#x:
|
||||
end virtual
|
||||
}
|
||||
|
|
@ -2,9 +2,7 @@ include stpd.base.mk
|
|||
|
||||
COMMON_DIR = ../common
|
||||
|
||||
COMMON_SRCS = const.inc \
|
||||
macro.inc
|
||||
|
||||
COMMON_SRCS = const.inc
|
||||
|
||||
BOOTIA32_EFI_SRCS = bootia32.asm \
|
||||
uefi.inc \
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
entry efimain
|
||||
|
||||
include '../common/const.inc'
|
||||
include '../common/macro.inc'
|
||||
include 'sys/macro.inc'
|
||||
include 'uefi.inc'
|
||||
include '../../kernel/sys/bootinfo.inc'
|
||||
include 'logger.inc'
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
format binary
|
||||
|
||||
include '../common/const.inc'
|
||||
include '../common/macro.inc'
|
||||
include 'sys/macro.inc'
|
||||
include 'multiboot.inc'
|
||||
|
||||
org LOADER_BASE
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
;; File: isr.inc
|
||||
|
||||
;; Macro: ISR
|
||||
macro ISR [name,error] {
|
||||
forward
|
||||
dd isr_#name
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
;; Kernel entry point
|
||||
;;
|
||||
;; In:
|
||||
;;
|
||||
;;
|
||||
;; EAX - Boot Magic
|
||||
;; EBX - Boot structure address
|
||||
;;
|
||||
|
|
@ -35,7 +35,7 @@ kmain:
|
|||
mov edi, stBootInfo
|
||||
rep movsb
|
||||
|
||||
; print hello world
|
||||
; print hello world
|
||||
mov [0xC00B8000], dword 0x08740953
|
||||
mov [0xC00B8004], dword 0x05700675
|
||||
mov [0xC00B8008], dword 0x03640469
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
COM1 = 0x3F8
|
||||
|
||||
;; Macro: TRACE
|
||||
macro TRACE msg, [arg] {
|
||||
common
|
||||
_ARGS = 0
|
||||
|
|
|
|||
|
|
@ -1,4 +1,33 @@
|
|||
;; File: bootinfo.inc
|
||||
;; StupidOS Boot protocol constants and structs
|
||||
|
||||
;; Constant: BOOT_HEADER_MAGIC
|
||||
BOOT_HEADER_MAGIC = 0x44505453
|
||||
;; Constant: BOOT_BOOTLOADER_MAGIC
|
||||
BOOT_BOOTLOADER_MAGIC = 0x53545044
|
||||
|
||||
;; Struct: BootHeader
|
||||
;;
|
||||
;; .magic - Must be <BOOT_HEADER_MAGIC>
|
||||
;; .load_end_addr - TODO
|
||||
;; .bss_end_addr - TODO
|
||||
;; .entry_addr - Kernel entry point
|
||||
struc BootHeader {
|
||||
.magic dd ?
|
||||
.load_end_addr dd ?
|
||||
.bss_end_addr dd ?
|
||||
.entry_addr dd ?
|
||||
}
|
||||
|
||||
;; Struct: BootMMapEntry
|
||||
;; Memory map entry
|
||||
;;
|
||||
;; .base - TODO
|
||||
;; .length - TODO
|
||||
struc BootMMapEntry {
|
||||
.base dq ?
|
||||
.length dq ?
|
||||
}
|
||||
|
||||
;; Struct: BootInfoRange
|
||||
struc BootInfoRange {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
;; File: macro.inc
|
||||
;; Utility macros
|
||||
|
||||
;; Macro: DEFN
|
||||
macro DEFN x {
|
||||
virtual at 0
|
||||
x x
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ ifndef TOOLSDIR
|
|||
$(error "TOOLSDIR is undefined")
|
||||
endif
|
||||
|
||||
FASM = fasm
|
||||
FASM = INCLUDE=$(SYSROOTDIR)$(ASMDIR) fasm
|
||||
CC = $(TOOLSDIR)/bin/tcc
|
||||
AR = ar
|
||||
FAS2SYM = $(TOOLSDIR)/bin/fas2sym
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue