forked from KolibriOS/kolibrios
Compare commits
75
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98a17eb931 | ||
|
|
68f0454682 | ||
|
|
d486c6b33a | ||
|
|
310999dcc4 | ||
|
|
bb769cbf85 | ||
|
|
9b9f10b231 | ||
|
|
ca99b669f2 | ||
|
|
fac0425ac0 | ||
|
|
175bd31489 | ||
|
|
e1a30a4f14 | ||
|
|
8235572f7b | ||
|
|
641603693f | ||
|
|
a016346e4e | ||
|
|
e7698cbfb6 | ||
|
|
27c1f44930 | ||
|
|
86c685ed4b | ||
|
|
e05b57a95e | ||
|
|
a0e4bce98a | ||
|
|
2cda4a9682 | ||
|
|
f08fe1f2a0 | ||
|
|
f7a26ece7a | ||
|
|
f5735e54f4 | ||
|
|
8a0329cee8 | ||
|
|
a4f3f3545a | ||
|
|
e0dc42d79b | ||
|
|
096cca20cb | ||
|
|
db529bc1a8 | ||
|
|
3e1c8e9ec8 | ||
|
|
e94fb7d5ef | ||
|
|
bd548e0373 | ||
|
|
6ad8a8b6cc | ||
|
|
48626298ff | ||
|
|
5cbac1a231 | ||
|
|
af62e17863 | ||
|
|
f8255f0d77 | ||
|
|
826b43e9c2 | ||
|
|
1434d2fd98 | ||
|
|
2a43081ba6 | ||
|
|
31cd7329df | ||
|
|
a9136a1684 | ||
|
|
bb6d4072a1 | ||
|
|
cb37ae10cb | ||
|
|
bdc12a2f00 | ||
|
|
430843a83f | ||
|
|
96cc7e7af4 | ||
|
|
54500c5100 | ||
|
|
4b1d291f17 | ||
|
|
c0e0827513 | ||
|
|
87adc0a1df | ||
|
|
0cd3b0c5b1 | ||
|
|
33acd57c58 | ||
|
|
d6a1b56b7f | ||
|
|
7bcb400040 | ||
|
|
398dcbb13d | ||
|
|
9ca506ed15 | ||
|
|
31880f3ebe | ||
|
|
27a26b669f | ||
|
|
3c1e533f95 | ||
|
|
f7a3e34289 | ||
|
|
a591b2b25a | ||
|
|
c948b48eb2 | ||
|
|
0b4562bac4 | ||
|
|
de6724017d | ||
|
|
f305d3425d | ||
|
|
b5981a39dc | ||
|
|
e9e9ebb4c8 | ||
|
|
4c359e42ce | ||
|
|
3238f9f485 | ||
|
|
289eabf8a4 | ||
|
|
e818e2167f | ||
|
|
42c205be32 | ||
|
|
0253ec8753 | ||
|
|
91dc4d8cad | ||
|
|
6f2a947deb | ||
|
|
735b86c476 |
No files matched your search
@@ -40,7 +40,7 @@ jobs:
|
||||
id: toolchain-hash
|
||||
run: |
|
||||
a=$(find ${{ gitea.workspace }}/programs/develop/cmm/ -type f -print0 | sort -z | xargs -0 sha1sum)
|
||||
b=$(sha1sum ${{ gitea.workspace }}/programs/develop/ktcc/trunk/bin/kos32-tcc)
|
||||
b=$(sha1sum ${{ gitea.workspace }}/programs/develop/ktcc/bin/kos32-tcc)
|
||||
c=$(find ${{ gitea.workspace }}/programs/develop/objconv/ -type f -print0 | sort -z | xargs -0 sha1sum)
|
||||
d=$(find ${{ gitea.workspace }}/programs/other/kpack/kerpack_linux/ -type f -print0 | sort -z | xargs -0 sha1sum)
|
||||
e=$(find ${{ gitea.workspace }}/programs/other/kpack/linux/ -type f -print0 | sort -z | xargs -0 sha1sum)
|
||||
@@ -67,7 +67,7 @@ jobs:
|
||||
- name: Install TCC
|
||||
if: steps.cache-toolchain.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
cp ${{ gitea.workspace }}/programs/develop/ktcc/trunk/bin/kos32-tcc /home/autobuild/tools/win32/bin/kos32-tcc
|
||||
cp ${{ gitea.workspace }}/programs/develop/ktcc/bin/kos32-tcc /home/autobuild/tools/win32/bin/kos32-tcc
|
||||
chmod +x /home/autobuild/tools/win32/bin/kos32-tcc
|
||||
|
||||
- name: Build and install objconv
|
||||
@@ -132,7 +132,7 @@ jobs:
|
||||
echo "CONFIG_LANG=ru_RU" >> ru_RU.config
|
||||
echo "CONFIG_BUILD_TYPE=ru_RU" >> ru_RU.config
|
||||
tup variant ru_RU.config
|
||||
|
||||
|
||||
# Configure es_ES
|
||||
echo "CONFIG_LANG=es_ES" >> es_ES.config
|
||||
echo "CONFIG_BUILD_TYPE=es_ES" >> es_ES.config
|
||||
|
||||
@@ -9,3 +9,9 @@ ehthumbs_vista.db
|
||||
._*
|
||||
programs/cmm/cmm.code-workspace
|
||||
programs/cmm/menu/.gitignore
|
||||
|
||||
.tup/
|
||||
|
||||
/build-*/
|
||||
/*.config
|
||||
|
||||
@@ -9,6 +9,10 @@ Its kernel, most drivers, and many programs are written entirely in [FASM](https
|
||||
|
||||
Based on [MenuetOS](https://www.menuetos.net/), it uses its own standards and is NOT fully POSIX or UNIX compliant.
|
||||
|
||||
## Website
|
||||
|
||||
Visit the [official KolibriOS website](https://kolibrios.org) for more information, downloads, and documentation.
|
||||
|
||||
## Contributing
|
||||
|
||||
We would appreciate any participation in the project and always welcome new users and contributors.
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
format coff
|
||||
use32 ; Tell compiler to use 32 bit instructions
|
||||
|
||||
@@ -7,8 +10,8 @@ include '../../../programs/proc32.inc'
|
||||
include '../../../programs/macros.inc'
|
||||
purge section,mov,add,sub
|
||||
|
||||
include '../../../programs/develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../../programs/system/run/trunk/txtbut.inc'
|
||||
include '../../../programs/develop/libraries/box_lib/box_lib.mac'
|
||||
include '../../../programs/system/run/txtbut.inc'
|
||||
include '../../../programs/dll.inc'
|
||||
|
||||
public init_boxlib as '_kolibri_boxlib_init'
|
||||
@@ -159,8 +162,8 @@ public path_show_draw as '_path_show_draw'
|
||||
|
||||
public fb_draw_panel as '_filebrowse_draw'
|
||||
public fb_mouse as '_filebrowse_mouse'
|
||||
public fb_key as '_filebrowse_key'
|
||||
|
||||
public fb_key as '_filebrowse_key'
|
||||
|
||||
public ted_but_sumb_upper as '_ted_but_sumb_upper'
|
||||
public ted_but_sumb_lover as '_ted_but_sumb_lover'
|
||||
public ted_but_convert_by_table as '_ted_but_convert_by_table'
|
||||
|
||||
@@ -1,152 +1,153 @@
|
||||
// BOXLIB example (scrollbar, progressbar)
|
||||
// ! without kolibri_gui !
|
||||
// Writed by maxcodehack
|
||||
// TCC version is in /programs/develop/ktcc/trunk/samples
|
||||
#include <kos32sys.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/// BOXLIB
|
||||
// Modified from C_Layer
|
||||
// C_Layer variant I don't like
|
||||
extern int kolibri_boxlib_init(void);
|
||||
typedef struct __attribute__ ((__packed__)) {
|
||||
uint16_t xsize;
|
||||
uint16_t xpos;
|
||||
uint16_t ysize;
|
||||
uint16_t ypos;
|
||||
uint32_t btn_height;
|
||||
uint32_t type;
|
||||
uint32_t max_area;
|
||||
uint32_t cur_area;
|
||||
uint32_t position;
|
||||
uint32_t back_color;
|
||||
uint32_t front_color;
|
||||
uint32_t line_color;
|
||||
uint32_t redraw;
|
||||
uint16_t delta;
|
||||
uint16_t delta2;
|
||||
uint16_t r_size_x;
|
||||
uint16_t r_start_x;
|
||||
uint16_t r_size_y;
|
||||
uint16_t r_start_y;
|
||||
uint32_t m_pos;
|
||||
uint32_t m_pos2;
|
||||
uint32_t m_keys;
|
||||
uint32_t run_size;
|
||||
uint32_t position2;
|
||||
uint32_t work_size;
|
||||
uint32_t all_redraw;
|
||||
uint32_t ar_offset;
|
||||
} scrollbar;
|
||||
|
||||
extern void (*scrollbar_h_draw)(scrollbar*) __attribute__((__stdcall__));
|
||||
extern void (*scrollbar_h_mouse)(scrollbar*) __attribute__((__stdcall__));
|
||||
extern void (*scrollbar_v_draw)(scrollbar*) __attribute__((__stdcall__));
|
||||
extern void (*scrollbar_v_mouse)(scrollbar*) __attribute__((__stdcall__));
|
||||
|
||||
typedef struct {
|
||||
unsigned int value;
|
||||
unsigned int left;
|
||||
unsigned int top;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
unsigned int style;
|
||||
unsigned int min;
|
||||
unsigned int max;
|
||||
unsigned int back_color;
|
||||
unsigned int progress_color;
|
||||
unsigned int frame_color;
|
||||
} progressbar;
|
||||
|
||||
extern void (*progressbar_draw)(progressbar *) __attribute__((__stdcall__));
|
||||
extern void (*progressbar_progress)(progressbar *) __attribute__((__stdcall__));
|
||||
/// BOXLIB
|
||||
|
||||
|
||||
#define evReDraw 1
|
||||
#define evKey 2
|
||||
#define evButton 3
|
||||
#define evExit 4
|
||||
#define evDesktop 5
|
||||
#define evMouse 6
|
||||
#define evIPC 7
|
||||
#define evNetwork 8
|
||||
#define evDebug 9
|
||||
|
||||
#define WIN_W 640
|
||||
#define WIN_H 563
|
||||
|
||||
uint32_t wheels;
|
||||
char* title = "Boxlib example";
|
||||
int win_bg_color = 0x858585;
|
||||
scrollbar scroll = {15, WIN_W - 26, WIN_H - 29, 0, 0, 2, 215, 15, 0,0x707070,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
progressbar pg = {0, 10, 10, 270, 35, 1, 0, 200, 0xB4B4B4, 0x2728FF, 0xA9A9A9};
|
||||
|
||||
void draw_window(){
|
||||
BeginDraw();
|
||||
DrawWindow(215,100,WIN_W,WIN_H,title,win_bg_color,0x34);
|
||||
scrollbar_v_draw(&scroll);
|
||||
progressbar_draw(&pg);
|
||||
EndDraw();
|
||||
}
|
||||
|
||||
//// EVENTMASK
|
||||
#define EVM_REDRAW 1
|
||||
#define EVM_KEY 2
|
||||
#define EVM_BUTTON 4
|
||||
#define EVM_EXIT 8
|
||||
#define EVM_BACKGROUND 16
|
||||
#define EVM_MOUSE 32
|
||||
#define EVM_IPC 64
|
||||
#define EVM_STACK 128
|
||||
#define EVM_DEBUG 256
|
||||
#define EVM_STACK2 512
|
||||
#define EVM_MOUSE_FILTER 0x80000000
|
||||
#define EVM_CURSOR_FILTER 0x40000000
|
||||
//// EVENTMASK
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
kolibri_boxlib_init();
|
||||
|
||||
set_wanted_events_mask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
|
||||
while(1)
|
||||
{
|
||||
switch(GetOsEvent())
|
||||
{
|
||||
case evButton:
|
||||
if (get_os_button() == 1) exit(0);
|
||||
break;
|
||||
|
||||
case evKey:
|
||||
get_key();
|
||||
break;
|
||||
|
||||
case evReDraw:
|
||||
draw_window();
|
||||
break;
|
||||
case evMouse:
|
||||
scrollbar_v_mouse(&scroll);
|
||||
|
||||
// Wheel scrolling
|
||||
// Quite unstable
|
||||
/*
|
||||
int scroll_strong = 40;
|
||||
wheels = GetMouseWheels();
|
||||
if(wheels & 0xFFFF)
|
||||
{
|
||||
if((short)wheels > 0 && scroll.position < scroll.max_area - scroll_strong)
|
||||
scroll.position += scroll_strong;
|
||||
else if((short)wheels < 0 && scroll.position > 0)
|
||||
scroll.position -= scroll_strong;
|
||||
|
||||
scrollbar_v_draw(&scroll);
|
||||
}
|
||||
*/
|
||||
pg.value = scroll.position;
|
||||
progressbar_draw(&pg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// BOXLIB example (scrollbar, progressbar)
|
||||
// ! without kolibri_gui !
|
||||
// Writed by maxcodehack
|
||||
// TCC version is in /programs/develop/ktcc/libc.obj/samples/clayer/boxlib.c
|
||||
|
||||
#include <kos32sys.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/// BOXLIB
|
||||
// Modified from C_Layer
|
||||
// C_Layer variant I don't like
|
||||
extern int kolibri_boxlib_init(void);
|
||||
typedef struct __attribute__ ((__packed__)) {
|
||||
uint16_t xsize;
|
||||
uint16_t xpos;
|
||||
uint16_t ysize;
|
||||
uint16_t ypos;
|
||||
uint32_t btn_height;
|
||||
uint32_t type;
|
||||
uint32_t max_area;
|
||||
uint32_t cur_area;
|
||||
uint32_t position;
|
||||
uint32_t back_color;
|
||||
uint32_t front_color;
|
||||
uint32_t line_color;
|
||||
uint32_t redraw;
|
||||
uint16_t delta;
|
||||
uint16_t delta2;
|
||||
uint16_t r_size_x;
|
||||
uint16_t r_start_x;
|
||||
uint16_t r_size_y;
|
||||
uint16_t r_start_y;
|
||||
uint32_t m_pos;
|
||||
uint32_t m_pos2;
|
||||
uint32_t m_keys;
|
||||
uint32_t run_size;
|
||||
uint32_t position2;
|
||||
uint32_t work_size;
|
||||
uint32_t all_redraw;
|
||||
uint32_t ar_offset;
|
||||
} scrollbar;
|
||||
|
||||
extern void (*scrollbar_h_draw)(scrollbar*) __attribute__((__stdcall__));
|
||||
extern void (*scrollbar_h_mouse)(scrollbar*) __attribute__((__stdcall__));
|
||||
extern void (*scrollbar_v_draw)(scrollbar*) __attribute__((__stdcall__));
|
||||
extern void (*scrollbar_v_mouse)(scrollbar*) __attribute__((__stdcall__));
|
||||
|
||||
typedef struct {
|
||||
unsigned int value;
|
||||
unsigned int left;
|
||||
unsigned int top;
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
unsigned int style;
|
||||
unsigned int min;
|
||||
unsigned int max;
|
||||
unsigned int back_color;
|
||||
unsigned int progress_color;
|
||||
unsigned int frame_color;
|
||||
} progressbar;
|
||||
|
||||
extern void (*progressbar_draw)(progressbar *) __attribute__((__stdcall__));
|
||||
extern void (*progressbar_progress)(progressbar *) __attribute__((__stdcall__));
|
||||
/// BOXLIB
|
||||
|
||||
|
||||
#define evReDraw 1
|
||||
#define evKey 2
|
||||
#define evButton 3
|
||||
#define evExit 4
|
||||
#define evDesktop 5
|
||||
#define evMouse 6
|
||||
#define evIPC 7
|
||||
#define evNetwork 8
|
||||
#define evDebug 9
|
||||
|
||||
#define WIN_W 640
|
||||
#define WIN_H 563
|
||||
|
||||
uint32_t wheels;
|
||||
char* title = "Boxlib example";
|
||||
int win_bg_color = 0x858585;
|
||||
scrollbar scroll = {15, WIN_W - 26, WIN_H - 29, 0, 0, 2, 215, 15, 0,0x707070,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
progressbar pg = {0, 10, 10, 270, 35, 1, 0, 200, 0xB4B4B4, 0x2728FF, 0xA9A9A9};
|
||||
|
||||
void draw_window(){
|
||||
BeginDraw();
|
||||
DrawWindow(215,100,WIN_W,WIN_H,title,win_bg_color,0x34);
|
||||
scrollbar_v_draw(&scroll);
|
||||
progressbar_draw(&pg);
|
||||
EndDraw();
|
||||
}
|
||||
|
||||
//// EVENTMASK
|
||||
#define EVM_REDRAW 1
|
||||
#define EVM_KEY 2
|
||||
#define EVM_BUTTON 4
|
||||
#define EVM_EXIT 8
|
||||
#define EVM_BACKGROUND 16
|
||||
#define EVM_MOUSE 32
|
||||
#define EVM_IPC 64
|
||||
#define EVM_STACK 128
|
||||
#define EVM_DEBUG 256
|
||||
#define EVM_STACK2 512
|
||||
#define EVM_MOUSE_FILTER 0x80000000
|
||||
#define EVM_CURSOR_FILTER 0x40000000
|
||||
//// EVENTMASK
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
kolibri_boxlib_init();
|
||||
|
||||
set_wanted_events_mask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
|
||||
while(1)
|
||||
{
|
||||
switch(GetOsEvent())
|
||||
{
|
||||
case evButton:
|
||||
if (get_os_button() == 1) exit(0);
|
||||
break;
|
||||
|
||||
case evKey:
|
||||
get_key();
|
||||
break;
|
||||
|
||||
case evReDraw:
|
||||
draw_window();
|
||||
break;
|
||||
case evMouse:
|
||||
scrollbar_v_mouse(&scroll);
|
||||
|
||||
// Wheel scrolling
|
||||
// Quite unstable
|
||||
/*
|
||||
int scroll_strong = 40;
|
||||
wheels = GetMouseWheels();
|
||||
if(wheels & 0xFFFF)
|
||||
{
|
||||
if((short)wheels > 0 && scroll.position < scroll.max_area - scroll_strong)
|
||||
scroll.position += scroll_strong;
|
||||
else if((short)wheels < 0 && scroll.position > 0)
|
||||
scroll.position -= scroll_strong;
|
||||
|
||||
scrollbar_v_draw(&scroll);
|
||||
}
|
||||
*/
|
||||
pg.value = scroll.position;
|
||||
progressbar_draw(&pg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,18 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
|
||||
SOURCES = {
|
||||
"src/*.asm",
|
||||
extra_inputs = {
|
||||
"src/*.inc"
|
||||
}
|
||||
}
|
||||
|
||||
OBJS = {
|
||||
extra_inputs = {
|
||||
"symbols"
|
||||
}
|
||||
}
|
||||
|
||||
tup.append_table(OBJS, tup.foreach_rule(SOURCES, "fasm %f %o", "%B.o"))
|
||||
|
||||
tup.rule(OBJS, "ar -cvrs %o %f && objcopy -O elf32-i386 --redefine-syms=symbols %o", {"libsound.a", "<libsound.a>"})
|
||||
+1070
-1044
File diff suppressed because it is too large.
Load diff
@@ -1,4 +1,4 @@
|
||||
[icons16]
|
||||
[icons18]
|
||||
<dir>=0
|
||||
<up>=1
|
||||
<lot>=20
|
||||
|
||||
File renamed without changes.
@@ -23,4 +23,7 @@ path=/usbhd0/1/kolibri.img
|
||||
autoclose=0
|
||||
|
||||
[WebView]
|
||||
proxy=http://proxy.kolibrios.org:82/?site=
|
||||
proxy_address=http://proxy.kolibrios.org/?site=
|
||||
search_engine=http://wiby.me/?q=
|
||||
;search_engine=http://bing.com/search?q=
|
||||
;search_engine=https://html.duckduckgo.com/html/?q=
|
||||
@@ -190,8 +190,8 @@ gbc=/kolibrios/emul/gameboy
|
||||
min=/kolibrios/emul/pokemini
|
||||
nc=/kolibrios/utils/cnc_editor/cnc_editor
|
||||
ch8=/kolibrios/emul/chip8/chip8
|
||||
md=/kolibrios/emul/dgen/dgen
|
||||
gen=/kolibrios/emul/dgen/dgen
|
||||
md=/kolibrios/emul/dgen/dgen_open
|
||||
gen=/kolibrios/emul/dgen/dgen_open
|
||||
rom=/kolibrios/emul/uxn
|
||||
|
||||
zip=$Unz
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2024. All rights reserved. ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2026. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; RTL8169 driver for KolibriOS ;;
|
||||
@@ -583,10 +583,7 @@ init_board:
|
||||
mov ecx, [esi+12]
|
||||
mov [ebx + device.name], ecx
|
||||
DEBUGF 2, "Detected chip: %s\n", ecx
|
||||
cmp dword[esi], 0
|
||||
jne @f
|
||||
DEBUGF 1, "TxConfig = 0x%x\n", eax
|
||||
@@:
|
||||
|
||||
xor eax, eax
|
||||
ret
|
||||
@@ -638,6 +635,9 @@ probe:
|
||||
WRITE_GMII_REG 0x0b, 0x0000 ; w 0x0b 15 0 0
|
||||
@@:
|
||||
; if TBI is not enabled
|
||||
cmp [ebx + device.mac_version], 01 ; Ten bit interface was only present on the original RTL8169
|
||||
jne .tbi_dis
|
||||
|
||||
set_io [ebx + device.io_addr], 0
|
||||
set_io [ebx + device.io_addr], REG_PHYstatus
|
||||
in al, dx
|
||||
@@ -649,6 +649,12 @@ probe:
|
||||
and eax, 0x0C1F
|
||||
or eax, PHY_Cap_10_Half or PHY_Cap_10_Full or PHY_Cap_100_Half or PHY_Cap_100_Full
|
||||
WRITE_GMII_REG PHY_AUTO_NEGO_REG, ax
|
||||
jmp .wait_aneg
|
||||
|
||||
.tbi_dis:
|
||||
DEBUGF 1, "Enabling 1000mbit modes\n"
|
||||
|
||||
set_io [ebx + device.io_addr], 0
|
||||
|
||||
; enable 1000 Full Mode
|
||||
WRITE_GMII_REG PHY_1000_CTRL_REG, PHY_Cap_1000_Full or PHY_Cap_1000_Half ; rtl8168
|
||||
@@ -656,8 +662,9 @@ probe:
|
||||
; Enable auto-negotiation and restart auto-nigotiation
|
||||
WRITE_GMII_REG PHY_CTRL_REG, PHY_Enable_Auto_Nego or PHY_Restart_Auto_Nego
|
||||
|
||||
.wait_aneg:
|
||||
udelay 1 ; 100
|
||||
mov ecx, 200 ; 10000
|
||||
mov ecx, 2000 ; 10000
|
||||
DEBUGF 1, "Waiting for auto-negotiation to complete\n"
|
||||
; wait for auto-negotiation process
|
||||
@@: dec ecx
|
||||
@@ -670,7 +677,7 @@ probe:
|
||||
set_io [ebx + device.io_addr], REG_PHYstatus
|
||||
in al, dx
|
||||
jmp @f
|
||||
.tbi_dis:
|
||||
DEBUGF 1, "auto-negotiation timed-out\n"
|
||||
udelay 1 ; 100
|
||||
@@:
|
||||
DEBUGF 1, "auto-negotiation complete\n"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
KTCC=kos32-tcc
|
||||
KPACK = kpack
|
||||
KLIBC = ../../../programs/develop/ktcc/trunk/libc.obj
|
||||
KLIBC = ../../../programs/develop/ktcc/libc.obj
|
||||
CFLAGS = -I $(KLIBC)/include
|
||||
LDFLAGS = -nostdlib -L$(KLIBC)/lib $(KLIBC)/lib/crt0.o
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||
ROOT = "../../../.."
|
||||
ROOT = "../../.."
|
||||
tup.rule("ps2mouse.asm", "fasm %f %o " .. tup.getconfig("PESTRIP_CMD") .. tup.getconfig("KPACK_CMD"), "%B.sys")
|
||||
File renamed without changes.
File renamed without changes.
+279
-276
@@ -1,276 +1,279 @@
|
||||
; standard driver stuff; version of driver model = 5
|
||||
format PE DLL native 0.05
|
||||
|
||||
DEBUG equ 1
|
||||
|
||||
MT_3B equ 0
|
||||
MT_3BScroll equ 3
|
||||
MT_5BScroll equ 4
|
||||
|
||||
PS2_DRV_VER equ 1
|
||||
|
||||
section '.flat' code readable writable executable
|
||||
data fixups
|
||||
end data
|
||||
include '../../../struct.inc'
|
||||
include '../../../macros.inc'
|
||||
include '../../../proc32.inc'
|
||||
include '../../../peimport.inc'
|
||||
|
||||
|
||||
entry START
|
||||
proc START c, state:dword, cmdline:dword
|
||||
|
||||
cmp [state], DRV_ENTRY
|
||||
je .init
|
||||
cmp [state], DRV_EXIT
|
||||
je .fini
|
||||
jmp .nothing
|
||||
.init:
|
||||
; disable keyboard and mouse interrupts
|
||||
; keyboard IRQ handler can interfere badly otherwise
|
||||
pushf
|
||||
cli
|
||||
mov bl, 0x20 ; read command byte
|
||||
call kbd_cmd
|
||||
test ah,ah
|
||||
jnz .fin
|
||||
call kbd_read
|
||||
test ah,ah
|
||||
jnz .fin
|
||||
popf
|
||||
and al, 0xFC ; disable interrupts
|
||||
or al, 0x10 ; disable keyboard
|
||||
push eax
|
||||
mov bl, 0x60 ; write command byte
|
||||
call kbd_cmd
|
||||
pop eax
|
||||
call kbd_write
|
||||
|
||||
call detect_mouse
|
||||
test eax,eax
|
||||
jnz .exit
|
||||
|
||||
mov [MouseType],MT_3B
|
||||
|
||||
call try_mode_ID3
|
||||
test eax,eax
|
||||
jnz .stop_try
|
||||
mov [MouseType],MT_3BScroll
|
||||
|
||||
call try_mode_ID4
|
||||
test eax,eax
|
||||
jnz .stop_try
|
||||
mov [MouseType],MT_5BScroll
|
||||
|
||||
.stop_try:
|
||||
|
||||
mov al, 0xF4 ; enable data reporting
|
||||
call mouse_cmd
|
||||
|
||||
; enable keyboard and mouse interrupts
|
||||
mov bl, 0x20 ; read command byte
|
||||
call kbd_cmd
|
||||
call kbd_read
|
||||
or al, 3 ; enable interrupts
|
||||
and al, not 0x10 ; enable keyboard
|
||||
push eax
|
||||
mov bl, 0x60 ; write command byte
|
||||
call kbd_cmd
|
||||
pop eax
|
||||
call kbd_write
|
||||
|
||||
invoke AttachIntHandler, 12, irq_handler, 0
|
||||
invoke RegService, my_service, service_proc
|
||||
ret
|
||||
|
||||
.fin:
|
||||
popf
|
||||
;invoke DetachIntHandler, 12, irq_handler
|
||||
mov bl, 0xA7 ; disable mouse interface
|
||||
call kbd_cmd
|
||||
.nothing:
|
||||
xor eax, eax
|
||||
ret
|
||||
.fini:
|
||||
mov al, 0xF5
|
||||
call mouse_cmd
|
||||
ret
|
||||
|
||||
.exit:
|
||||
mov bl, 0xA7 ; disable mouse interface
|
||||
call kbd_cmd
|
||||
|
||||
; enable keyboard interrupt, leave mouse interrupt disabled
|
||||
mov bl, 0x20 ; read command byte
|
||||
call kbd_cmd
|
||||
call kbd_read
|
||||
or al, 1 ; enable keyboard interrupt
|
||||
and al, not 0x10 ; enable keyboard
|
||||
push eax
|
||||
mov bl, 0x60 ; write command byte
|
||||
call kbd_cmd
|
||||
pop eax
|
||||
call kbd_write
|
||||
|
||||
xor eax, eax
|
||||
ret
|
||||
endp
|
||||
|
||||
proc service_proc stdcall, ioctl:dword
|
||||
mov edi, [ioctl]
|
||||
mov eax, [edi+IOCTL.io_code]
|
||||
test eax, eax
|
||||
jz .getversion
|
||||
cmp eax,1
|
||||
jz .gettype
|
||||
|
||||
.err:
|
||||
or eax, -1
|
||||
ret
|
||||
|
||||
.ok:
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
.getversion:
|
||||
cmp [edi+IOCTL.out_size], 4
|
||||
jb .err
|
||||
mov edi, [edi+IOCTL.output]
|
||||
mov dword [edi], PS2_DRV_VER ; version of driver
|
||||
jmp .ok
|
||||
.gettype:
|
||||
cmp [edi+IOCTL.out_size], 4
|
||||
jb .err
|
||||
mov edi, [edi+IOCTL.output]
|
||||
mov eax,[MouseType]
|
||||
mov dword [edi], eax ; mouse type
|
||||
jmp .ok
|
||||
endp
|
||||
|
||||
detect_mouse:
|
||||
|
||||
mov bl, 0xA8 ; enable mouse interface
|
||||
call kbd_cmd
|
||||
cmp ah,1
|
||||
je .fail
|
||||
|
||||
mov al, 0xFF ; reset
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
|
||||
call mouse_read
|
||||
jc .fail
|
||||
cmp al, 0xAA
|
||||
jne .fail ; dead mouse
|
||||
|
||||
; get device ID
|
||||
call mouse_read
|
||||
jc .fail
|
||||
cmp al, 0x00
|
||||
jne .fail ; unknown device
|
||||
|
||||
xor eax,eax
|
||||
ret
|
||||
|
||||
.fail:
|
||||
or eax,-1
|
||||
ret
|
||||
|
||||
try_mode_ID3:
|
||||
mov al, 0xF3 ;Set Sample Rate
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0xC8 ;200d
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0xF3 ;Set Sample Rate
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0x64 ;100d
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0xF3 ;Set Sample Rate
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0x50 ;80d
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
|
||||
mov al, 0xF2 ;Get device id
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
|
||||
call mouse_read
|
||||
jc .fail
|
||||
cmp al, 0x03
|
||||
jne .fail
|
||||
|
||||
xor eax,eax
|
||||
ret
|
||||
.fail:
|
||||
or eax,-1
|
||||
ret
|
||||
|
||||
try_mode_ID4:
|
||||
mov al, 0xF3 ;Set Sample Rate
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0xC8 ;200d
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0xF3 ;Set Sample Rate
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0xC8 ;100d
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0xF3 ;Set Sample Rate
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0x50 ;80d
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
|
||||
mov al, 0xF2 ;Get device id
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
|
||||
call mouse_read
|
||||
jc .fail
|
||||
cmp al, 0x04
|
||||
jne .fail
|
||||
|
||||
xor eax,eax
|
||||
ret
|
||||
|
||||
.fail:
|
||||
or eax,-1
|
||||
ret
|
||||
|
||||
include 'ps2m_iofuncs.inc'
|
||||
include 'ps2m_irqh.inc'
|
||||
|
||||
my_service db 'ps2mouse',0
|
||||
|
||||
;iofuncs data
|
||||
mouse_cmd_byte db 0
|
||||
mouse_nr_tries db 0
|
||||
mouse_nr_resends db 0
|
||||
|
||||
;hid data
|
||||
mouse_byte dd 0
|
||||
|
||||
first_byte db 0
|
||||
second_byte db 0
|
||||
third_byte db 0
|
||||
fourth_byte db 0
|
||||
|
||||
;main data
|
||||
MouseType dd 0
|
||||
|
||||
XMoving dd 0
|
||||
YMoving dd 0
|
||||
ZMoving dd 0
|
||||
ButtonState dd 0
|
||||
;timerTicks dd 0
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; standard driver stuff; version of driver model = 5
|
||||
format PE DLL native 0.05
|
||||
|
||||
DEBUG equ 1
|
||||
|
||||
MT_3B equ 0
|
||||
MT_3BScroll equ 3
|
||||
MT_5BScroll equ 4
|
||||
|
||||
PS2_DRV_VER equ 1
|
||||
|
||||
section '.flat' code readable writable executable
|
||||
data fixups
|
||||
end data
|
||||
include '../../struct.inc'
|
||||
include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../peimport.inc'
|
||||
|
||||
|
||||
entry START
|
||||
proc START c, state:dword, cmdline:dword
|
||||
|
||||
cmp [state], DRV_ENTRY
|
||||
je .init
|
||||
cmp [state], DRV_EXIT
|
||||
je .fini
|
||||
jmp .nothing
|
||||
.init:
|
||||
; disable keyboard and mouse interrupts
|
||||
; keyboard IRQ handler can interfere badly otherwise
|
||||
pushf
|
||||
cli
|
||||
mov bl, 0x20 ; read command byte
|
||||
call kbd_cmd
|
||||
test ah,ah
|
||||
jnz .fin
|
||||
call kbd_read
|
||||
test ah,ah
|
||||
jnz .fin
|
||||
popf
|
||||
and al, 0xFC ; disable interrupts
|
||||
or al, 0x10 ; disable keyboard
|
||||
push eax
|
||||
mov bl, 0x60 ; write command byte
|
||||
call kbd_cmd
|
||||
pop eax
|
||||
call kbd_write
|
||||
|
||||
call detect_mouse
|
||||
test eax,eax
|
||||
jnz .exit
|
||||
|
||||
mov [MouseType],MT_3B
|
||||
|
||||
call try_mode_ID3
|
||||
test eax,eax
|
||||
jnz .stop_try
|
||||
mov [MouseType],MT_3BScroll
|
||||
|
||||
call try_mode_ID4
|
||||
test eax,eax
|
||||
jnz .stop_try
|
||||
mov [MouseType],MT_5BScroll
|
||||
|
||||
.stop_try:
|
||||
|
||||
mov al, 0xF4 ; enable data reporting
|
||||
call mouse_cmd
|
||||
|
||||
; enable keyboard and mouse interrupts
|
||||
mov bl, 0x20 ; read command byte
|
||||
call kbd_cmd
|
||||
call kbd_read
|
||||
or al, 3 ; enable interrupts
|
||||
and al, not 0x10 ; enable keyboard
|
||||
push eax
|
||||
mov bl, 0x60 ; write command byte
|
||||
call kbd_cmd
|
||||
pop eax
|
||||
call kbd_write
|
||||
|
||||
invoke AttachIntHandler, 12, irq_handler, 0
|
||||
invoke RegService, my_service, service_proc
|
||||
ret
|
||||
|
||||
.fin:
|
||||
popf
|
||||
;invoke DetachIntHandler, 12, irq_handler
|
||||
mov bl, 0xA7 ; disable mouse interface
|
||||
call kbd_cmd
|
||||
.nothing:
|
||||
xor eax, eax
|
||||
ret
|
||||
.fini:
|
||||
mov al, 0xF5
|
||||
call mouse_cmd
|
||||
ret
|
||||
|
||||
.exit:
|
||||
mov bl, 0xA7 ; disable mouse interface
|
||||
call kbd_cmd
|
||||
|
||||
; enable keyboard interrupt, leave mouse interrupt disabled
|
||||
mov bl, 0x20 ; read command byte
|
||||
call kbd_cmd
|
||||
call kbd_read
|
||||
or al, 1 ; enable keyboard interrupt
|
||||
and al, not 0x10 ; enable keyboard
|
||||
push eax
|
||||
mov bl, 0x60 ; write command byte
|
||||
call kbd_cmd
|
||||
pop eax
|
||||
call kbd_write
|
||||
|
||||
xor eax, eax
|
||||
ret
|
||||
endp
|
||||
|
||||
proc service_proc stdcall, ioctl:dword
|
||||
mov edi, [ioctl]
|
||||
mov eax, [edi+IOCTL.io_code]
|
||||
test eax, eax
|
||||
jz .getversion
|
||||
cmp eax,1
|
||||
jz .gettype
|
||||
|
||||
.err:
|
||||
or eax, -1
|
||||
ret
|
||||
|
||||
.ok:
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
.getversion:
|
||||
cmp [edi+IOCTL.out_size], 4
|
||||
jb .err
|
||||
mov edi, [edi+IOCTL.output]
|
||||
mov dword [edi], PS2_DRV_VER ; version of driver
|
||||
jmp .ok
|
||||
.gettype:
|
||||
cmp [edi+IOCTL.out_size], 4
|
||||
jb .err
|
||||
mov edi, [edi+IOCTL.output]
|
||||
mov eax,[MouseType]
|
||||
mov dword [edi], eax ; mouse type
|
||||
jmp .ok
|
||||
endp
|
||||
|
||||
detect_mouse:
|
||||
|
||||
mov bl, 0xA8 ; enable mouse interface
|
||||
call kbd_cmd
|
||||
cmp ah,1
|
||||
je .fail
|
||||
|
||||
mov al, 0xFF ; reset
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
|
||||
call mouse_read
|
||||
jc .fail
|
||||
cmp al, 0xAA
|
||||
jne .fail ; dead mouse
|
||||
|
||||
; get device ID
|
||||
call mouse_read
|
||||
jc .fail
|
||||
cmp al, 0x00
|
||||
jne .fail ; unknown device
|
||||
|
||||
xor eax,eax
|
||||
ret
|
||||
|
||||
.fail:
|
||||
or eax,-1
|
||||
ret
|
||||
|
||||
try_mode_ID3:
|
||||
mov al, 0xF3 ;Set Sample Rate
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0xC8 ;200d
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0xF3 ;Set Sample Rate
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0x64 ;100d
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0xF3 ;Set Sample Rate
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0x50 ;80d
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
|
||||
mov al, 0xF2 ;Get device id
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
|
||||
call mouse_read
|
||||
jc .fail
|
||||
cmp al, 0x03
|
||||
jne .fail
|
||||
|
||||
xor eax,eax
|
||||
ret
|
||||
.fail:
|
||||
or eax,-1
|
||||
ret
|
||||
|
||||
try_mode_ID4:
|
||||
mov al, 0xF3 ;Set Sample Rate
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0xC8 ;200d
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0xF3 ;Set Sample Rate
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0xC8 ;100d
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0xF3 ;Set Sample Rate
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
mov al, 0x50 ;80d
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
|
||||
mov al, 0xF2 ;Get device id
|
||||
call mouse_cmd
|
||||
jc .fail
|
||||
|
||||
call mouse_read
|
||||
jc .fail
|
||||
cmp al, 0x04
|
||||
jne .fail
|
||||
|
||||
xor eax,eax
|
||||
ret
|
||||
|
||||
.fail:
|
||||
or eax,-1
|
||||
ret
|
||||
|
||||
include 'ps2m_iofuncs.inc'
|
||||
include 'ps2m_irqh.inc'
|
||||
|
||||
my_service db 'ps2mouse',0
|
||||
|
||||
;iofuncs data
|
||||
mouse_cmd_byte db 0
|
||||
mouse_nr_tries db 0
|
||||
mouse_nr_resends db 0
|
||||
|
||||
;hid data
|
||||
mouse_byte dd 0
|
||||
|
||||
first_byte db 0
|
||||
second_byte db 0
|
||||
third_byte db 0
|
||||
fourth_byte db 0
|
||||
|
||||
;main data
|
||||
MouseType dd 0
|
||||
|
||||
XMoving dd 0
|
||||
YMoving dd 0
|
||||
ZMoving dd 0
|
||||
ButtonState dd 0
|
||||
;timerTicks dd 0
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 2447 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user