Skip to content

Commit bbb6d5e

Browse files
committed
fix get_inf for network
1 parent 757bc5f commit bbb6d5e

File tree

9 files changed

+41
-19
lines changed

9 files changed

+41
-19
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ kernel: $(SOURCE)
9393
@echo "########################################################"
9494
@$(AS) --verbose -s -tnone --debug-info -o kernel_bank0.ld65 -DWITH_TWILIGHTE_BOARD=1 src/kernel_bank0.s $(ASFLAGS) > output.log
9595
@echo "WITH_TWILIGHTE_BOARD">$(PATH_PACKAGE_ROM)/kernelus.lst
96-
@$(AS) --verbose -s -tnone --debug-info -o kernelus.ld65 $(SOURCE) $(ASFLAGS) > output.log
97-
@$(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
96+
@$(AS) --verbose -s -tnone --debug-info -o kernelus.ld65 $(SOURCE) $(ASFLAGS) > output.log
97+
@$(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
9898
@cp kernel.rom kernelus.rom
9999
@cp kernelus.rom $(PATH_PACKAGE_ROM)/
100100

buildr64.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#! /bin/bash
22
#make
3-
NAME_TO_BUILD=k2023-2.r64
3+
NAME_TO_BUILD=k2025-1.r64
4+
5+
make
46

57
cp ../../shell/develop/shell.rom $NAME_TO_BUILD
68
cat basicus2.rom >> $NAME_TO_BUILD
79
cat kernelus.rom >> $NAME_TO_BUILD
8-
cat ../../empty-rom/empty-rom.rom >> $NAME_TO_BUILD
10+
cat kernel8.rom >> $NAME_TO_BUILD
911

1012
cp $NAME_TO_BUILD /mnt/s/devus.r64
1113
# NAME_TO_BUILD2=k2023-1.r64

run.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ fi
8585
echo "##########"
8686
echo "# Bank 8 #"
8787
echo "##########"
88-
ld65 -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
88+
ld65 -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/kch395/usr/share/kch395/2025.1/kch395.lib src/kernel8/orixlibs/ch395/usr/share/ch395/2024.4/ch395.lib -o kernel8.rom -Ln tmp/kernel8sd.sym -m tmp/memmap8.txt -vm
8989

9090
RET=$?
9191
if [ $RET != 0 ]
@@ -112,6 +112,7 @@ ld65 -C cfg/kernel.cfg -DWITH_SDCARD_FOR_ROOT=1 tmp/kernelsd.ld65 tmp/kernel_ba
112112
# dependencies/orix-sdk/bin/relocbin.py3 -o tmp/sfbtest -2 tmp/1000 tmp/1256
113113
# cp tmp/sfbtest $ORICUTRON_PATH/sdcard/bin/
114114

115+
echo Build autoboot
115116
cl65 -ttelestrat tests/functions/network/netchk.s -o tmp/1000 --start-addr 2048
116117
cl65 -ttelestrat tests/functions/network/netchk.s -o tmp/1256 --start-addr 2304
117118
dependencies/orix-sdk/bin/relocbin.py3 -o tmp/netchk -2 tmp/1000 tmp/1256

src/functions/lib_mng/XBANK_ROUTINE.s

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ XNETWORK_START_ROUTINE := XBANK_ROUTINE
1515
.segment "BANK7"
1616

1717
.proc XBANK_ROUTINE
18+
19+
1820
pha
1921
lda #<$C000
2022
sta VEXBNK+1

src/functions/network/init_network.s

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
.import ch395_dhcp_enable
1212

1313
.import ch395_get_ip_inf
14+
.import kch395_get_ip_inf
1415

1516
.import KERNEL_NETWORK_FLAG
1617
.import KERNEL_NETWORK_SOCKET_LIST
@@ -63,14 +64,19 @@
6364

6465
cmp #KERNEL_NETWORK_STATE_NOT_INITIALIZED
6566
beq @initialize
67+
6668
cmp #KERNEL_NETWORK_STATE_CHIP_INITIALIZED
6769
beq @checking_cable
70+
6871
cmp #KERNEL_NETWORK_CABLE_DISCONNECTED
6972
beq @checking_cable
73+
7074
cmp #KERNEL_NETWORK_CABLE_CONNECTED
7175
beq @start_dhcp
76+
7277
cmp #KERNEL_NETWORK_STARTING_DHCP
7378
beq @start_dhcp
79+
7480
rts
7581

7682
@initialize:
@@ -107,8 +113,8 @@
107113
; Check IP
108114
lda #<RES
109115
ldx #>RES
110-
jsr ch395_get_ip_inf
111-
116+
;jsr ch395_get_ip_inf
117+
jsr kch395_get_ip_inf
112118
lda RES
113119
cmp #$00
114120
beq @dhcp_not_started

src/kernel.asm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ start_rom:
176176
lda #CH376_SET_USB_MODE_CODE_SDCARD
177177
.else
178178
lda #CH376_SET_USB_MODE_CODE_USB_HOST_SOF_PACKAGE_AUTOMATICALLY
179+
.out "Building usb device kernel"
179180
.endif
180181

181182
sta KERNEL_CH376_MOUNT
@@ -494,6 +495,7 @@ init_malloc_busy_table:
494495
; ****************************************************************************
495496
; Set stage for kernel init
496497

498+
497499
lda #KERNEL_START_NETWORK
498500
jsr XNETWORK_START_ROUTINE
499501

src/kernel8/bpm.tml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ orix_minimal_kernel_version = "2024.1"
2424
[dependencies]
2525
ch395 = "2024.4"
2626
ksocket = "2025.1"
27+
kch395 = "2025.1"

src/libs/ch376-lib/src/ch376.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ loop:
143143
.warning "Build for sdcard by default"
144144
lda #CH376_SET_USB_MODE_CODE_SDCARD
145145
.else
146-
.warning "Build by usb key"
146+
.warning "[Default] Build for usb key"
147147
lda #CH376_SET_USB_MODE_CODE_USB_HOST_SOF_PACKAGE_AUTOMATICALLY
148148
.endif
149149
lda KERNEL_CH376_MOUNT

tests/functions/network/netchk.s

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ ptr_recv := userzp + 5
6363

6464

6565
start_adress:
66-
6766
malloc #4096
6867
cmp #$00
6968
beq @not_oom
@@ -72,6 +71,7 @@ start_adress:
7271
print str_oom
7372
crlf
7473
rts
74+
7575
@not_oom:
7676
sta ptr_recv
7777
sty ptr_recv+1
@@ -85,7 +85,7 @@ start_adress:
8585
@start:
8686
dec retry
8787
beq @end
88-
88+
nop
8989
; print str_bank_id_given
9090
lda #KERNEL_START_NETWORK ; Mode
9191
BRK_TELEMON $01 ; Get network state
@@ -112,12 +112,13 @@ start_adress:
112112
crlf
113113
rts
114114

115-
115+
nop
116116

117117
@fully_started:
118+
crlf
118119
print str_fully_started
119120
crlf
120-
jmp @socket
121+
rts
121122

122123
@disconnected:
123124
print str_cable_disconnected
@@ -127,12 +128,12 @@ start_adress:
127128
@connected:
128129
print str_cable_connected
129130
crlf
130-
jmp @waiting
131+
print str_starting_dhcp
132+
jmp @start
131133

132134
@dhcp_starting:
133-
print str_starting_dhcp
134-
crlf
135-
jmp @waiting
135+
print #'.'
136+
jmp @start
136137

137138
@dhcp_started:
138139
print str_started_dhcp
@@ -151,6 +152,12 @@ start_adress:
151152
@socket:
152153

153154
@loop_socket:
155+
;lda ip ; 12
156+
;ldy #00 ; 0 because the number is 12 (from A)
157+
;print_int ,2, 2 ; an arg is skipped because the number is from register
158+
; lda #' '
159+
; BRK_TELEMON XWR0
160+
nop
154161
print str_socket
155162

156163

@@ -202,7 +209,7 @@ start_adress:
202209
sta RES + 1
203210
ldy #18
204211
ldx #$00
205-
212+
nop
206213
lda #KERNEL_SEND_NETWORK ; Connect
207214
BRK_TELEMON $01
208215
cmp #$00
@@ -287,6 +294,7 @@ str_socket_error:
287294
.byte $81, "Socket open error",0
288295

289296
ip:
297+
;.byte 213,186,33,19
290298
.byte 192,168,1,77
291299

292300
str_invalid_socket:
@@ -299,7 +307,7 @@ str_waiting:
299307
.asciiz "Waiting ..."
300308

301309
str_started_dhcp:
302-
.asciiz "Started dhcp !!"
310+
.asciiz "Dhcp Started !"
303311

304312
str_starting_dhcp:
305313
.asciiz "Starting dhcp"
@@ -312,7 +320,7 @@ str_cable_disconnected:
312320

313321
str_cable_connected:
314322
.asciiz "Cable connected"
315-
323+
nop
316324

317325
; sta tmp1
318326
; stx tmp2

0 commit comments

Comments
 (0)