From 7acdbd2b5b1f06facb3714084c6e28db1c79160c Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 26 Dec 2021 16:00:44 +0000 Subject: [PATCH] geode loader: load driver from the same folder git-svn-id: svn://kolibrios.org@9478 a494cfbc-eb01-0410-851d-a64ba20cac60 --- drivers/audio/a5536/Tupfile.lua | 3 ++ drivers/audio/a5536/geode.asm | 66 +++++++++++++++++++++------------ 2 files changed, 46 insertions(+), 23 deletions(-) create mode 100644 drivers/audio/a5536/Tupfile.lua diff --git a/drivers/audio/a5536/Tupfile.lua b/drivers/audio/a5536/Tupfile.lua new file mode 100644 index 0000000000..729ccece59 --- /dev/null +++ b/drivers/audio/a5536/Tupfile.lua @@ -0,0 +1,3 @@ +if tup.getconfig("NO_FASM") ~= "" then return end +ROOT = "../../.." +tup.rule("geode.asm", "fasm %f %o " .. tup.getconfig("PESTRIP_CMD") .. tup.getconfig("KPACK_CMD"), "%B") diff --git a/drivers/audio/a5536/geode.asm b/drivers/audio/a5536/geode.asm index 529fd683ac..c180ba7e2d 100644 --- a/drivers/audio/a5536/geode.asm +++ b/drivers/audio/a5536/geode.asm @@ -1,35 +1,55 @@ - use32 - db 'MENUET01' -dd 1 -dd start -dd i_end -dd mem -dd mem -dd 0 -dd 0 +dd 1, start, i_end, mem, mem, 0, selfpath start: - mov eax, 68 - mov ebx, 16 - mov ecx, sz_sound - int 0x40 - test eax, eax - jnz .exit +;------ strcat(selfpath, '.drv') + mov eax, selfpath + @@: + inc eax + cmp [eax], byte 0 + jne @b + mov [eax], dword '.drv' - mov eax, 68 - mov ebx, 21 - mov ecx, sz_path - int 0x40 +;------ writing some info + mov edx, info_msg + call debug_string + mov cl, 13 ; line break symbol + int 40h + +;------ init driver + mov eax, 68 + mov ebx, 16 + mov ecx, sz_sound + int 40h + test eax, eax + jnz .exit + + mov eax, 68 + mov ebx, 21 + mov ecx, selfpath + int 40h .exit: - mov eax, -1 - int 0x40 - + mov eax, -1 + int 40h + +debug_string: + mov eax,63 + mov ebx,1 + @@: + mov cl,[edx] + test cl,cl + jz @f + int 40h + inc edx + jmp @b + @@: + ret sz_sound db 'SOUND',0 -sz_path db '/rd/1/drivers/geode.drv',0 +info_msg db 'Trying to load the driver: ' +selfpath rb 4096 align 4 i_end: