Compare commits

...

2 Commits

Author SHA1 Message Date
6ccc7e27fe fb2reader: add to oberon07 build system
Signed-off-by: hrigar <h4gar02@protonmail.com>
2026-02-24 22:07:47 +05:30
Igor Shutrov
f9425f5bd0 ftpd: Add help command 2026-02-23 21:18:26 +00:00
6 changed files with 80 additions and 8 deletions

View File

@@ -25,7 +25,6 @@ img_files = {
{"MACROS.INC", SRC_PROGS .. "/macros.inc"},
-- {"CONFIG.INC", SRC_PROGS .. "/config.inc"},
{"STRUCT.INC", SRC_PROGS .. "/struct.inc"},
{"FB2READ", "common/fb2read"},
{"ALLGAMES", "common/allgames"},
{"HOME.PNG", "common/wallpapers/T_Home.png"},
{"ICONS32.PNG", "common/icons32.png"},
@@ -749,6 +748,7 @@ end -- tup.getconfig('NO_TCC') ~= 'full'
if tup.getconfig('NO_OB07') ~= 'full' then
tup.append_table(img_files, {
{"DEVELOP/CEDIT", VAR_PROGS .. "/develop/cedit/cedit"},
{"FB2READ", VAR_PROGS .. "/other/fb2reader/fb2read"},
})
end -- tup.getconfig('NO_OB07') ~= 'full'

Binary file not shown.

View File

@@ -86,7 +86,7 @@ commands: ; all commands must be in uppercase
dd 'CWD', login_first, login_first, login_first, cmdCWD
dd 'XCWD', login_first, login_first, login_first, cmdCWD
dd 'DELE', login_first, login_first, login_first, cmdDELE
; dd 'HELP', login_first, login_first, login_first, cmd_HELP
dd 'HELP', login_first, login_first, login_first, cmdHELP
dd 'LIST', login_first, login_first, login_first, cmdLIST
; dd 'MDTM', login_first, login_first, login_first, cmd_MDTM
; dd 'MKD', login_first, login_first, login_first, cmd_MKD
@@ -1247,6 +1247,68 @@ cmdTYPE:
sendFTP "200 Command ok"
ret
;------------------------------------------------
; "HELP"
;
; Provide help information.
;
;------------------------------------------------
align 4
cmdHELP:
lea edi, [ebp + thread_data.buffer]
mov eax, '214 '
stosd
mov eax, 'Help'
stosd
mov ax, ': '
stosw
mov esi, commands ; pointer to commands table
.next_command:
cmp byte [esi], 0 ; end of table?
je .list_done
; Copy command name (4 bytes), skip null bytes
mov ecx, 4
.copy_name:
mov al, [esi]
test al, al
jz .skip_null
stosb
.skip_null:
inc esi
loop .copy_name
; Add space after command name
mov al, ' '
stosb
; Skip the four address pointers (16 bytes)
add esi, 16
jmp .next_command
.list_done:
; Remove trailing space (if any)
dec edi
; Add CRLF
mov ax, 0x0a0d ; \r\n
stosw
xor al, al ; null terminator
stosb
; Calculate length
lea edx, [ebp + thread_data.buffer]
sub edi, edx
; Send response
mcall send, [ebp + thread_data.socketnum], edx, edi
; Also log to console
invoke con_write_asciiz, edx
ret
;------------------------------------------------
; "USER"
;

View File

@@ -0,0 +1,9 @@
if tup.getconfig("NO_OB07") ~= "" then return end
if tup.getconfig("HELPERDIR") == ""
then
HELPERDIR = "../../"
end
tup.include(HELPERDIR .. "/use_ob07.lua")
build_ob07({"SRC/FB2READ.ob07"}, "fb2read", "-upper");

View File

@@ -1,6 +1,7 @@
OB07 = tup.getcwd() .. "/develop/oberon07/compiler"
OB07_FLAGS = "-stk 1 -nochk a"
function build_ob07(input, output)
tup.rule(input, OB07 .. " %f kosexe -out %o " .. OB07_FLAGS .. " " .. tup.getconfig("KPACK_CMD"), output)
end
OB07 = tup.getcwd() .. "/develop/oberon07/compiler"
OB07_FLAGS = "-stk 1 -nochk a"
function build_ob07(input, output, extra_flags)
extra_flags = extra_flags or ""
tup.rule(input, OB07 .. " %f kosexe -out %o " .. OB07_FLAGS .. " " .. extra_flags .. " " .. tup.getconfig("KPACK_CMD") .. " && touch %o", output)
end