-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
16 changed files
with
1,743 additions
and
576 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
; | ||
; The common memory area traditionally starts with the udata and the | ||
; interrupt stacks. As this is standard in almost all cases you can | ||
; just include the standard implementation. | ||
; | ||
.common | ||
|
||
#include "../../cpu-z80u/std-commonmem.s" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,66 @@ | ||
# 0 "commonmem.S" | ||
# 0 "<built-in>" | ||
# 0 "<command-line>" | ||
# 1 "commonmem.S" | ||
; | ||
; The common memory area traditionally starts with the udata and the | ||
; interrupt stacks. As this is standard in almost all cases you can | ||
; just include the standard implementation. | ||
; The common memory area traditionally starts with the udata and the | ||
; interrupt stacks. As this is standard in almost all cases you can | ||
; just include the standard implementation. | ||
; | ||
.module commonmem | ||
.common | ||
|
||
# 1 "../../cpu-z80u/std-commonmem.s" 1 | ||
# 0 "../../cpu-z80u/std-commonmem.S" | ||
# 0 "<built-in>" | ||
# 0 "<command-line>" | ||
# 1 "/usr/include/stdc-predef.h" 1 3 4 | ||
# 0 "<command-line>" 2 | ||
# 1 "../../cpu-z80u/std-commonmem.S" | ||
; | ||
; | ||
; Standard Z80 common memory area blocks. | ||
; | ||
; Must remain a multiple of 256 bytes | ||
; | ||
; exported symbols | ||
.export _ub | ||
.export _udata | ||
.export kstack_top | ||
.export istack_top | ||
.export istack_switched_sp | ||
|
||
.area _COMMONMEM | ||
|
||
.include "../../cpu-z80/std-commonmem.s" | ||
_ub: ; first 512 bytes: starts with struct u_block, with the kernel stack working down from above | ||
_udata: | ||
kstack_base: | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
.byte 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | ||
istack_top: | ||
istack_switched_sp: .word 0 | ||
# 9 "commonmem.S" 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.code | ||
|
||
; Load at 0x0100 | ||
; We are executed from ROMWBW so we live in bank 14/15 | ||
; with the HBIOS proxy at FE00 | ||
start: | ||
di | ||
ld sp, kstack_top | ||
; move the common memory where it belongs | ||
ld hl, __bss | ||
ld de, __common | ||
ld bc, __common_size | ||
ldir | ||
ld de, __commondata | ||
ld bc, __commondata_size | ||
ldir | ||
; then the discard | ||
; Discard can just be linked in but is next to the buffers | ||
ld de, __discard | ||
ld bc, __discard_size-1 | ||
add hl,bc | ||
ex de,hl | ||
add hl,bc | ||
ex de,hl | ||
lddr | ||
; then zero the data area | ||
ld hl, __bss | ||
ld de, __bss + 1 | ||
ld bc, __bss_size - 1 | ||
ld (hl), 0 | ||
ldir | ||
; Zero buffers area | ||
ld hl, __buffers | ||
ld de, __buffers + 1 | ||
ld bc, __buffers_size | ||
ld (hl), 0 | ||
ldir | ||
call init_early | ||
call init_hardware | ||
call _fuzix_main | ||
di | ||
stop: halt | ||
jr stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,47 @@ | ||
; Ordering of segments for the linker. | ||
.area _CODE | ||
.area _CODE2 | ||
.area _HOME | ||
.area _CONST | ||
.area _INITIALIZED | ||
.area _DATA | ||
.area _BSEG | ||
.area _BSS | ||
.area _HEAP | ||
.area _GSINIT | ||
.area _GSFINAL | ||
.area _BUFFERS | ||
.area _INITIALIZER | ||
.area _DISCARD | ||
.area _COMMONMEM | ||
.area _COMMONDATA | ||
# 0 "crt0.S" | ||
# 0 "<built-in>" | ||
# 0 "<command-line>" | ||
# 1 "crt0.S" | ||
.code | ||
|
||
; imported symbols | ||
.globl _fuzix_main | ||
.globl init_early | ||
.globl init_hardware | ||
.globl s__DATA | ||
.globl l__DATA | ||
.globl s__DISCARD | ||
.globl l__DISCARD | ||
.globl s__BUFFERS | ||
.globl l__BUFFERS | ||
.globl s__COMMONMEM | ||
.globl l__COMMONMEM | ||
.globl s__COMMONDATA | ||
.globl l__COMMONDATA | ||
.globl s__INITIALIZER | ||
.globl kstack_top | ||
.globl map_kernel | ||
|
||
; startup code | ||
.area _CODE | ||
|
||
; Load at 0x0100 | ||
; We are executed from ROMWBW so we live in bank 14/15 | ||
; with the HBIOS proxy at FE00 | ||
; Load at 0x0100 | ||
; We are executed from ROMWBW so we live in bank 14/15 | ||
; with the HBIOS proxy at FE00 | ||
start: | ||
di | ||
ld sp, #kstack_top | ||
; move the common memory where it belongs | ||
ld hl, #s__DATA | ||
ld de, #s__COMMONMEM | ||
ld bc, #l__COMMONMEM | ||
ldir | ||
ld de, #s__COMMONDATA | ||
ld bc, #l__COMMONDATA | ||
ldir | ||
; then the discard | ||
; Discard can just be linked in but is next to the buffers | ||
ld de, #s__DISCARD | ||
ld bc, #l__DISCARD | ||
ldir | ||
; then zero the data area | ||
ld hl, #s__DATA | ||
ld de, #s__DATA + 1 | ||
ld bc, #l__DATA - 1 | ||
ld (hl), #0 | ||
ldir | ||
; Zero buffers area | ||
ld hl, #s__BUFFERS | ||
ld de, #s__BUFFERS + 1 | ||
ld bc, #l__BUFFERS - 1 | ||
ld (hl), #0 | ||
ldir | ||
call init_early | ||
call init_hardware | ||
call _fuzix_main | ||
di | ||
stop: halt | ||
jr stop | ||
di | ||
ld sp, kstack_top | ||
; move the common memory where it belongs | ||
ld hl, __bss | ||
ld de, __common | ||
ld bc, __common_size | ||
ldir | ||
ld de, __commondata | ||
ld bc, __commondata_size | ||
ldir | ||
; then the discard | ||
; Discard can just be linked in but is next to the buffers | ||
ld de, __discard | ||
ld bc, __discard_size-1 | ||
add hl,bc | ||
ex de,hl | ||
add hl,bc | ||
ex de,hl | ||
lddr | ||
; then zero the data area | ||
ld hl, __bss | ||
ld de, __bss + 1 | ||
ld bc, __bss_size - 1 | ||
ld (hl), 0 | ||
ldir | ||
; Zero buffers area | ||
ld hl, __buffers | ||
ld de, __buffers + 1 | ||
ld bc, __buffers_size | ||
ld (hl), 0 | ||
ldir | ||
call init_early | ||
call init_hardware | ||
call _fuzix_main | ||
di | ||
stop: halt | ||
jr stop |
Oops, something went wrong.