Skip to content

Commit 87d8e23

Browse files
committed
prepare 2025.1
1 parent 7f00be5 commit 87d8e23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3914
-562
lines changed

Makefile

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,44 @@ init:
3737
kernel: $(SOURCE)
3838
@echo Rom are built in $(PATH_PACKAGE_ROM)
3939
@echo Build kernelsd.rom for Twilighte board
40-
@$(AS) --verbose -s -tnone --debug-info -o kernelsd.ld65 -DWITH_SDCARD_FOR_ROOT=1 $(SOURCE) $(ASFLAGS) > output.log
41-
@$(LD) -C src/kernel.cfg kernelsd.ld65 -m kernelsd.map -DWITH_SDCARD_FOR_ROOT=1 -DWITH_TWILIGHTE_BOARD=1 -Ln kernelsd.sym > output.log
40+
@$(AS) --cpu 6502 -tnone src/functions/strings/xminma.asm -o tmp/xminma.o
41+
@$(AS) --cpu 6502 -tnone src/functions/bank_mng/search_free_bank.s -o tmp/search_free_bank.o
42+
@$(AS) --cpu 6502 -tnone src/functions/bank_mng/kernel_free_bank.s -o tmp/kernel_free_bank.o
43+
@$(AS) --cpu 6502 -tnone src/functions/bank_mng/kernel_free_bank_by_pid.s -o tmp/kernel_free_bank_by_pid.o
44+
@$(AR) r tmp/kernel.lib tmp/xminma.o
45+
@$(AR) r tmp/kernel.lib tmp/xminma.o
46+
@$(AR) r tmp/kernel.lib tmp/switch_to_kernel_extended.o
47+
@$(AR) r tmp/kernel.lib tmp/kernel_restore_banking_states.o
48+
@$(AR) r tmp/kernel.lib tmp/xbank_routine.o
49+
@$(AR) r tmp/kernel_bank8.lib tmp/init_network.o
50+
@$(AR) r tmp/kernel_bank8.lib tmp/search_free_bank.o
51+
@$(AR) r tmp/kernel_bank8.lib tmp/kernel_free_bank.o
52+
@$(AR) r tmp/kernel_bank8.lib tmp/kernel_free_bank_by_pid.o
53+
@$(AR) r tmp/kernel_bank8.lib tmp/xsocket.o
54+
@$(AR) r tmp/kernel_bank8.lib tmp/xconnect.o
55+
@$(AR) r tmp/kernel_bank8.lib tmp/xsend.o
56+
@$(AR) r tmp/kernel_bank8.lib tmp/xclose_socket.o
57+
58+
@$(AS) --verbose -s -tnone --debug-info --cpu 6502 -tnone src/kernel8/src/kernel8.s -o tmp/kernel_bank8.ld65 $(ASFLAGS) > output.log
59+
@$(AS) --verbose -s -tnone --debug-info -o kernel_bank0.ld65 -DWITH_SDCARD_FOR_ROOT=1 src/kernel_bank0.s $(ASFLAGS) > output.log
60+
@$(AS) --verbose -s -tnone --debug-info -o kernelsd.ld65 -DWITH_SDCARD_FOR_ROOT=1 $(SOURCE) $(ASFLAGS) > output.log
61+
62+
@$(AS) --cpu 6502 -DWITH_SDCARD_FOR_ROOT=1 --verbose -s -ttelestrat src/kernel_bank0.s -o tmp/kernel_bank0.ld65 --debug-info > memmap.md
63+
@$(LD) -C cfg/rom.cfg tmp/kernel_bank8.ld65 tmp/kernel_bank0.ld65 tmp/kernel_main_memory.ld65 tmp/kernel_bank8.lib src/kernel8/orixlibs/ksocket/usr/share/ksocket/2025.1/ksocket.lib src/kernel8/orixlibs/ch395/usr/share/ch395/2024.4/ch395.lib -o kernel8.rom -Ln tmp/kernel8sd.sym -m tmp/memmap8.txt -vm
64+
4265
@cp kernel.rom kernelsd.rom
43-
@sed -re 's/al 00(.{4}) \.(.+)$$/\1 \2/' kernelsd.sym| sort > kernelsd2.sym > output.log
66+
#@sed -re 's/al 00(.{4}) \.(.+)$$/\1 \2/' kernelsd.sym| sort > kernelsd2.sym > output.log
4467
@cp kernelsd.rom $(PATH_PACKAGE_ROM)/
45-
@cp kernelsd.sym $(PATH_PACKAGE_ROM)/
46-
@cp kernelsd.map $(PATH_PACKAGE_ROM)/
68+
#@cp kernelsd.sym $(PATH_PACKAGE_ROM)/
69+
#@cp kernelsd.map $(PATH_PACKAGE_ROM)/
4770

48-
@echo Build kernelus.rom for Twilighte board
71+
@echo "########################################################"
72+
@echo "# Build kernelus.rom for Twilighte board #"
73+
@echo "########################################################"
74+
@$(AS) --verbose -s -tnone --debug-info -o kernel_bank0.ld65 -DWITH_TWILIGHTE_BOARD=1 src/kernel_bank0.s $(ASFLAGS) > output.log
4975
@echo "WITH_TWILIGHTE_BOARD">$(PATH_PACKAGE_ROM)/kernelus.lst
5076
@$(AS) --verbose -s -tnone --debug-info -o kernelus.ld65 $(SOURCE) $(ASFLAGS) > output.log
51-
@$(LD) -C src/kernel.cfg kernelus.ld65 -m kernelus.map -DWITH_TWILIGHTE_BOARD=1 -Ln kernelus.sym > output.log
77+
@$(LD) -C cfg/kernel.cfg tmp/kernelsd.ld65 tmp/kernel_bank0.ld65 tmp/kernel_main_memory.ld65 tmp/kernel.lib -m kernelus.map -DWITH_TWILIGHTE_BOARD=1 -Ln kernelus.sym > output.log
5278
@cp kernel.rom kernelus.rom
5379
@cp kernelus.rom $(PATH_PACKAGE_ROM)/
5480

@@ -60,7 +86,7 @@ unittest:
6086

6187
memmap:
6288
@$(AS) --verbose -s -tnone --debug-info -o kernel-telestrat.ld65 -DWITH_SDCARD_FOR_ROOT=1 $(SOURCE) $(ASFLAGS) > memmap.md
63-
@$(LD) -C src/kernel.cfg kernel-telestrat.ld65 -m kernel.map -o kernel-telestrat.ld65.rom -DWITH_ACIA=2 -DWITH_SDCARD_FOR_ROOT=1 -Ln kernel-telestrat.ca.sym
89+
@$(LD) -C cfg/kernel.cfg tmp/kernelsd.ld65 tmp/kernel_bank0.ld65 tmp/kernel_main_memory.ld65 tmp/kernel.lib -m kernelus.map -o kernel-telestrat.ld65.rom -DWITH_ACIA=2 -DWITH_SDCARD_FOR_ROOT=1 -Ln kernel-telestrat.ca.sym
6490
@sh generate_memmap.sh
6591

6692
test:

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,53 @@ here is the list of available "compile option"
3737
* Kernel tries to start binary set in his rom label 'str_binary_to_start'
3838
* it allocates a process struct (first malloc)
3939
* and register it in processlist
40+
41+
42+
## generate .inc
43+
44+
MEMORY {
45+
#...
46+
47+
KRNL1: file = "kernel.rom", start = $C000, size = $3FFF;
48+
KRNL2: file = "kernel2.rom", start =$C000, size = $3FFF;
49+
INCL: file="kernel2.inc", start=$0000, size = $FFFF;
50+
}
51+
SEGMENTS {
52+
# ...
53+
KERNEL: load = KRNL1, type = ro, define = yes, optional = yes;
54+
EXTEND: load = KRNL2, type = ro, define = yes, optional = yes;
55+
INCLUDE: load = INCL, optional = yes;
56+
}
57+
58+
59+
60+
61+
.feature org_per_seg
62+
.pushseg
63+
.segment "EXTEND"
64+
.org $C000 ;
65+
66+
67+
; .segment "KERNEL"
68+
; .org $C000
69+
70+
71+
.popseg
72+
Macro
73+
74+
75+
.macro addsym symbole
76+
.pushseg
77+
.segment "INCLUDE"
78+
.byte .sprintf("%s = $%x", .string(symbole), symbole)
79+
.popseg
80+
.endmacro
81+
82+
Et enfin, pour ajouter un symbole dans le fichier .inc:
83+
84+
.proc xvalue_routine
85+
lda #$00
86+
....
87+
.endproc
88+
89+
addsym xvalue_routine

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2024.3
1+
2025.1

cfg/kernel.cfg

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FEATURES {
2+
STARTADDRESS: default = $1000;
3+
}
4+
SYMBOLS {
5+
__STACKSIZE__: type = weak, value = $0800; # 2k stack
6+
__STACKSTART__: type = weak, value = $8000;
7+
__ZPSTART__: type = weak, value = $0080;
8+
}
9+
MEMORY {
10+
ZP: file = "", define = yes, start = __ZPSTART__, size = $001F;
11+
MAIN: file = %O, start = %S, size = __STACKSTART__ - __STACKSIZE__ - %S;
12+
13+
BANK7: type = ro, start = $C000, size = $4000-16, file = "kernel.rom", fill = yes;
14+
ORIXVEC7: start = $FFF0, size = 10 , file = "kernel.rom", fill = yes;
15+
CPUVEC7: start = $FFFA, size = 6 , file = "kernel.rom", fill = yes;
16+
INCL: file = "kernel_inc.inc", start=$0000, size = $FFFF;
17+
18+
}
19+
SEGMENTS {
20+
ZEROPAGE: load = ZP, type = zp;
21+
STARTUP: load = MAIN, type = ro, define = yes, optional = yes;
22+
LOWCODE: load = MAIN, type = ro, define = yes, optional = yes;
23+
ONCE: load = MAIN, type = ro, define = yes, optional = yes;
24+
CODE: load = MAIN, type = rw, define = yes, optional = yes;
25+
RODATA: load = MAIN, type = rw, define = yes, optional = yes;
26+
DATA: load = MAIN, type = rw, define = yes, optional = yes;
27+
BSS: load = MAIN, type = bss, define = yes, optional = yes;
28+
29+
SIGNATURE: load = MAIN, type = ro, define = yes, optional = yes;
30+
INCLUDE: load = INCL, optional = yes;
31+
# BANK8: load = BANK8, type = ro;
32+
# ORIXVECT8: load = ORIXVEC8, type = ro, define = yes, optional = yes;
33+
# CPUVECT8: load = CPUVEC8, type = ro, define = yes, optional = yes;
34+
35+
BANK7: load = BANK7 , type = ro, define = yes;
36+
ORIXVECT7: load = ORIXVEC7, type = ro, define = yes;
37+
CPUVECT7: load = CPUVEC7, type = ro, define = yes;
38+
39+
# BANK0: load = BANK0, type = ro;
40+
# ORIXVECT0: load = ORIXVEC0, type = ro, define = yes, optional = yes;
41+
# CPUVECT0: load = CPUVEC0, type = ro, define = yes, optional = yes;
42+
}
43+
FEATURES {
44+
CONDES: type = constructor,
45+
label = __CONSTRUCTOR_TABLE__,
46+
count = __CONSTRUCTOR_COUNT__,
47+
segment = ONCE;
48+
CONDES: type = destructor,
49+
label = __DESTRUCTOR_TABLE__,
50+
count = __DESTRUCTOR_COUNT__,
51+
segment = RODATA;
52+
CONDES: type = interruptor,
53+
label = __INTERRUPTOR_TABLE__,
54+
count = __INTERRUPTOR_COUNT__,
55+
segment = RODATA,
56+
import = __CALLIRQ__;
57+
}
58+

cfg/kernel_bank8.cfg

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
FEATURES {
2+
STARTADDRESS: default = $C000;
3+
}
4+
SYMBOLS {
5+
__STACKSIZE__: type = weak, value = $0800; # 2k stack
6+
__STACKSTART__: type = weak, value = $8000;
7+
__ZPSTART__: type = weak, value = $0080;
8+
}
9+
MEMORY {
10+
ZP: file = "", define = yes, start = __ZPSTART__, size = $001F;
11+
MAIN: file = %O, start = %S, size = $10000 - %S - 16, fill = yes, fillval = $ff;
12+
13+
BANK8: type = ro, start = $C000, size = $4000-16, file = "kernel8.rom", fill = yes;
14+
ORIXVEC: start = $FFF0, size = 10 , file = "kernel8.rom", fill = yes;
15+
CPUVEC: start = $FFFA, size = 6 , file = "kernel8.rom", fill = yes;
16+
}
17+
SEGMENTS {
18+
ZEROPAGE: load = ZP, type = zp;
19+
STARTUP: load = MAIN, type = ro, optional = yes;
20+
LOWCODE: load = MAIN, type = ro, optional = yes;
21+
ONCE: load = MAIN, type = ro, optional = yes;
22+
CODE: load = MAIN, type = rw;
23+
RODATA: load = MAIN, type = rw;
24+
DATA: load = MAIN, type = rw;
25+
BSS: load = MAIN, type = bss, define = yes, optional = yes;
26+
# BSS: load = MAIN, type = bss, define = yes;
27+
SIGNATURE: load = MAIN, type = ro, define = yes, optional = yes;
28+
ORIXVECT: load = ORIXVEC, type = ro, define = yes;
29+
CPUVECT: load = CPUVEC, type = ro, define = yes;
30+
BANK8: load = BANK8 , type = ro, define = yes;
31+
32+
}
33+
FEATURES {
34+
CONDES: type = constructor,
35+
label = __CONSTRUCTOR_TABLE__,
36+
count = __CONSTRUCTOR_COUNT__,
37+
segment = ONCE;
38+
CONDES: type = destructor,
39+
label = __DESTRUCTOR_TABLE__,
40+
count = __DESTRUCTOR_COUNT__,
41+
segment = RODATA;
42+
CONDES: type = interruptor,
43+
label = __INTERRUPTOR_TABLE__,
44+
count = __INTERRUPTOR_COUNT__,
45+
segment = RODATA,
46+
import = __CALLIRQ__;
47+
}
48+
49+
# FEATURES {
50+
# STARTADDRESS: default = $C000;
51+
# }
52+
# SYMBOLS {
53+
# # __STACKSIZE__: type = weak, value = $0800; # 2k stack
54+
# # __STACKSTART__: type = weak, value = $8000;
55+
# # __ZPSTART__: type = weak, value = $0080;
56+
# }
57+
# MEMORY {
58+
# # ZP: file = "", define = yes, start = __ZPSTART__, size = $001F;
59+
# MAIN: file = %O, start = %S, size = $4000;
60+
61+
# # BANK8: type = ro, start = $C000, size = $4000-16, file = "kernel8.rom", fill = yes;
62+
63+
# # CPUVEC8: start = $FFFA, size = 6 , file = "kernel8.rom", fill = yes;
64+
# }
65+
# SEGMENTS {
66+
# # ZEROPAGE: load = ZP, type = zp;
67+
# # STARTUP: load = MAIN, type = ro, define = yes, optional = yes;
68+
# # LOWCODE: load = MAIN, type = ro, define = yes, optional = yes;
69+
# # ONCE: load = MAIN, type = ro, define = yes, optional = yes;
70+
# CODE: load = MAIN, type = ro, define = yes, optional = yes;
71+
# # RODATA: load = MAIN, type = ro, define = yes, optional = yes;
72+
# # DATA: load = MAIN, type = ro, define = yes, optional = yes;
73+
# # BSS: load = MAIN, type = bss, define = yes, optional = yes;
74+
75+
# # SIGNATURE: load = MAIN, type = ro, define = yes, optional = yes;
76+
77+
# # BANK8: load = BANK8, type = ro;
78+
# # ORIXVECT8: load = ORIXVEC8, type = ro, define = yes, optional = yes;
79+
# # CPUVECT8: load = CPUVEC8, type = ro, define = yes, optional = yes;
80+
81+
82+
# }

cfg/rom.cfg

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FEATURES {
2+
STARTADDRESS: default = $C000;
3+
}
4+
5+
SYMBOLS {
6+
__ZPSTART__: type = weak, value = $0000;
7+
}
8+
9+
MEMORY {
10+
ZP: file = "", define = yes, start = __ZPSTART__, size = $0100 - __ZPSTART__;
11+
MAIN: file = %O, start = %S, size = $10000 - %S - 16, fill = yes, fillval = $ff;
12+
ORIXVEC: start = $FFF0, size = 10;
13+
CPUVEC: start = $FFFA, size = 6;
14+
}
15+
16+
SEGMENTS {
17+
ZEROPAGE: load = ZP, type = zp;
18+
ENTRY_TBL: load = MAIN, type = ro, optional = yes;
19+
CODE: load = MAIN, type = ro, define = yes;
20+
DATA: load = MAIN, type = ro, optional = yes;
21+
RODATA: load = MAIN, type = ro, optional = yes;
22+
BSS: load = MAIN, type = ro, optional = yes;
23+
# INSTRTBL: load = MAIN, type = ro, define = yes;
24+
# INSTRTBL2: load = MAIN, type = ro, define = yes;
25+
# INSTRJMP: load = MAIN, type = ro, define = yes;
26+
SIGNATURE: load = MAIN, type = ro, define = yes, optional = yes;
27+
ORIXVECT: load = ORIXVEC, type = ro, define = yes;
28+
CPUVECT: load = CPUVEC, type = ro, define = yes;
29+
}

run.bat

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)