Compile in core/sys32.inc

This commit is contained in:
Ivan Baravy 2023-01-12 21:24:06 +00:00
parent e8f75d1d03
commit 102dad1daf
4 changed files with 53 additions and 19 deletions

View File

@ -16,10 +16,17 @@ start:
pushfd pushfd
btr dword[esp], BSF EFLAGS.ID btr dword[esp], BSF EFLAGS.ID
popfd popfd
mov ecx, '0'
next_char:
cmp ecx, '9'
jbe @f
mov ecx, '0'
@@: @@:
jmp $ mcall 63, 1
mcall 63, 1, '*' ;jmp $
jmp @b mcall 5, 10
inc ecx
jmp next_char
exit: exit:
mcall 18, 9, 2 mcall 18, 9, 2
mcall -1 mcall -1

View File

@ -336,14 +336,16 @@ purge cmp
purge mov purge mov
restore OS_BASE restore OS_BASE
include 'core/sync.inc' include 'core/sync.inc'
;include 'core/sys32.inc'
macro call target { macro call target {
if target eq do_change_task if target eq do_change_task
call _do_change_task call _do_change_task
else if target eq page_fault_handler
call _page_fault_handler
else else
call target call target
end if end if
} }
include 'core/sys32.inc'
do_change_task equ hjk do_change_task equ hjk
irq0 equ irq0_pew irq0 equ irq0_pew
tss._io_map_0 equ 0 tss._io_map_0 equ 0
@ -762,11 +764,12 @@ endp
pubsym skin_udata pubsym skin_udata
proc idle uses ebx esi edi proc idle uses ebx esi edi
sti
.loop: .loop:
mov ecx, 10000000 mov ecx, 10000000
@@: @@:
loop @b loop @b
DEBUGF 1, "1 idle\n" ; DEBUGF 1, "1 idle\n"
jmp .loop jmp .loop
ret ret
@ -793,6 +796,10 @@ proc _pci_read_reg uses ebx esi edi
ret ret
endp endp
proc _page_fault_handler
ret
endp
proc sys_msg_board proc sys_msg_board
cmp cl, 0x0d cmp cl, 0x0d
jz @f jz @f
@ -901,8 +908,6 @@ check_fdd_motor_status:
check_ATAPI_device_event: check_ATAPI_device_event:
check_fdd_motor_status_has_work?: check_fdd_motor_status_has_work?:
check_ATAPI_device_event_has_work?: check_ATAPI_device_event_has_work?:
request_terminate:
terminate:
LoadMedium: LoadMedium:
clear_CD_cache: clear_CD_cache:
allow_medium_removal: allow_medium_removal:
@ -913,23 +918,28 @@ init_sys_v86:
usb_init: usb_init:
fdc_init: fdc_init:
mtrr_validate: mtrr_validate:
protect_from_terminate: ; sys32.inc
unprotect_from_terminate: ;terminate:
;protect_from_terminate:
;unprotect_from_terminate:
;lock_application_table:
;unlock_application_table:
;build_interrupt_table:
;sys_resize_app_memory:
;request_terminate:
v86_exc_c:
except_7:
ReadCDWRetr: ReadCDWRetr:
WaitUnitReady: WaitUnitReady:
prevent_medium_removal: prevent_medium_removal:
Read_TOC: Read_TOC:
lock_application_table:
unlock_application_table:
free_page: free_page:
build_interrupt_table:
init_fpu: init_fpu:
init_mtrr: init_mtrr:
create_trampoline_pgmap: create_trampoline_pgmap:
alloc_page: alloc_page:
;sys_IPC: ;sys_IPC:
sys_resize_app_memory:
;f68: ;f68:
v86_irq: v86_irq:
;test_cpu: ;test_cpu:
@ -1129,6 +1139,10 @@ forward
dw 0 dw 0
else if x eq (tss shr 16) and 0xFF00 else if x eq (tss shr 16) and 0xFF00
dw 0 dw 0
else if x eq i40 and 0xFFFF
dw 0
else if x eq i40 shr 16
dw 0
else else
dw x dw x
end if end if

10
umka.h
View File

@ -1120,6 +1120,16 @@ umka_sys_write_text(size_t x, size_t y, uint32_t color, int asciiz,
: "memory"); : "memory");
} }
static inline void
umka_sys_delay(size_t cs) {
__asm__ __inline__ __volatile__ (
"call i40"
:
: "a"(5),
"b"(cs)
: "memory");
}
static inline void static inline void
umka_sys_put_image(void *image, size_t xsize, size_t ysize, size_t x, umka_sys_put_image(void *image, size_t xsize, size_t ysize, size_t x,
size_t y) { size_t y) {

View File

@ -164,17 +164,18 @@ main() {
kos_boot.pitch = UMKA_DEFAULT_DISPLAY_WIDTH*4; // 32bpp kos_boot.pitch = UMKA_DEFAULT_DISPLAY_WIDTH*4; // 32bpp
umka_init(); umka_init();
umka_stack_init(); // umka_stack_init();
FILE *f = fopen("../img/kolibri.img", "r"); FILE *f = fopen("../img/kolibri.raw", "r");
fread(kos_ramdisk, 2880*512, 1, f); fread(kos_ramdisk, 2880*512, 1, f);
fclose(f); fclose(f);
kos_ramdisk_init(); kos_ramdisk_init();
// load_app_host("../apps/board_cycle", app_base); // load_app_host("../apps/board_cycle", app_base);
load_app_host("../apps/lsdir", app_base);
// load_app("/rd/1/loader"); // load_app("/rd/1/loader");
net_device_t *vnet = vnet_init(); // net_device_t *vnet = vnet_init();
kos_net_add_device(vnet); // kos_net_add_device(vnet);
char devname[64]; char devname[64];
for (size_t i = 0; i < umka_sys_net_get_dev_count(); i++) { for (size_t i = 0; i < umka_sys_net_get_dev_count(); i++) {
@ -184,6 +185,7 @@ main() {
fprintf(stderr, "[net_drv] device %i: %s %u\n", i, devname, devtype); fprintf(stderr, "[net_drv] device %i: %s %u\n", i, devname, devtype);
} }
/*
// network setup should be done from the userspace app, e.g. via zeroconf // network setup should be done from the userspace app, e.g. via zeroconf
f76ret_t r76; f76ret_t r76;
r76 = umka_sys_net_ipv4_set_subnet(1, inet_addr("255.255.255.0")); r76 = umka_sys_net_ipv4_set_subnet(1, inet_addr("255.255.255.0"));
@ -209,9 +211,10 @@ main() {
fprintf(stderr, "[net_drv] set ip addr error\n"); fprintf(stderr, "[net_drv] set ip addr error\n");
return -1; return -1;
} }
*/
// thread_start(0, monitor, THREAD_STACK_SIZE);
thread_start(0, monitor, THREAD_STACK_SIZE); thread_start(0, app_base, THREAD_STACK_SIZE);
dump_procs(); dump_procs();