Use a CreateProcessA argument instead of chdir on Windows
Plus minor build fixes
This commit is contained in:
parent
d59526a8af
commit
2f58d4453d
16
makefile
16
makefile
@ -32,10 +32,14 @@ CFLAGS=$(WARNINGS) $(NOWARNINGS) -std=c11 -g -O0 -DNDEBUG -masm=intel \
|
||||
CFLAGS_32=$(CFLAGS) -m32 -D_FILE_OFFSET_BITS=64 -D__USE_TIME_BITS64
|
||||
LDFLAGS=-no-pie
|
||||
LDFLAGS_32=$(LDFLAGS) -m32
|
||||
LIBS=-lpthread
|
||||
LIBS_COMMON=-lpthread
|
||||
|
||||
ifeq ($(HOST),windows)
|
||||
LIBS=$(LIBS) -lws2_32
|
||||
ifeq ($(HOST),linux)
|
||||
LIBS=$(LIBS_COMMON)
|
||||
else ifeq ($(HOST),windows)
|
||||
LIBS=$(LIBS_COMMON) -lws2_32
|
||||
else
|
||||
$(error your HOST is not supported)
|
||||
endif
|
||||
|
||||
ifeq ($(HOST),linux)
|
||||
@ -45,7 +49,7 @@ else ifeq ($(HOST),windows)
|
||||
FASM_INCLUDE=$(KOLIBRIOS)\kernel\trunk;$(KOLIBRIOS)\programs\develop\libraries\libcrash\hash
|
||||
FASM=set "INCLUDE=$(FASM_INCLUDE)" && $(FASM_EXE) $(FASM_FLAGS)
|
||||
else
|
||||
$(error your OS is not supported)
|
||||
$(error your HOST is not supported)
|
||||
endif
|
||||
|
||||
ifeq ($(HOST),linux)
|
||||
@ -54,7 +58,7 @@ all: umka_shell umka_fuse umka_os umka_gen_devices_dat umka.sym umka.prp \
|
||||
else ifeq ($(HOST),windows)
|
||||
all: umka_shell umka.sym umka.prp umka.lst default.skn skin.skn test/runtests
|
||||
else
|
||||
$(error your OS is not supported)
|
||||
$(error your HOST is not supported)
|
||||
endif
|
||||
|
||||
.PHONY: test
|
||||
@ -180,7 +184,7 @@ umka_gen_devices_dat.o: umka_gen_devices_dat.c umka.h
|
||||
$(CC) $(CFLAGS_32) -c $<
|
||||
|
||||
test/runtests: test/runtests.o deps/optparse/optparse.o
|
||||
$(CC) $(LDFLAGS_32) -o $@ $^
|
||||
$(CC) $(LDFLAGS_32) -o $@ $^ $(LIBS)
|
||||
|
||||
test/runtests.o: test/runtests.c
|
||||
$(CC) $(CFLAGS_32) -c $< -o $@ -Wno-deprecated-declarations
|
||||
|
@ -212,8 +212,8 @@ run_test(const void *arg) {
|
||||
memset(&pi, 0, sizeof(pi));
|
||||
unsigned tout = get_test_timeout(test_name);
|
||||
|
||||
if(!CreateProcess(NULL, "../../umka_shell -ri run.us -o out.log", NULL,
|
||||
NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
|
||||
if(!CreateProcessA(NULL, "../umka_shell -ri run.us -o out.log", NULL,
|
||||
NULL, FALSE, 0, NULL, test_name, &si, &pi)) {
|
||||
fprintf(stderr, "CreateProcess failed: %lu\n", GetLastError());
|
||||
return (void *)-1;
|
||||
}
|
||||
|
12
umka.asm
12
umka.asm
@ -100,8 +100,8 @@ UMKA_BOOT_DEFAULT_DISPLAY_BPP = 32
|
||||
UMKA_BOOT_DEFAULT_DISPLAY_WIDTH = 400
|
||||
UMKA_BOOT_DEFAULT_DISPLAY_HEIGHT = 300
|
||||
|
||||
public idle_scheduled
|
||||
public os_scheduled
|
||||
pubsym idle_scheduled, 'idle_scheduled'
|
||||
pubsym os_scheduled, 'os_scheduled'
|
||||
pubsym irq_serv.irq_10, 'kos_irq_serv_irq10'
|
||||
pubsym idts, 'kos_idts'
|
||||
pubsym attach_int_handler, 'kos_attach_int_handler', 12
|
||||
@ -132,8 +132,8 @@ pubsym coverage_end
|
||||
|
||||
pubsym sha3_256_oneshot, 'hash_oneshot'
|
||||
pubsym kos_time_to_epoch
|
||||
pubsym umka_init, 4
|
||||
pubsym umka_close, 4
|
||||
pubsym umka_init, 'umka_init'
|
||||
pubsym umka_close, 'umka_close'
|
||||
pubsym umka_boot
|
||||
|
||||
pubsym current_process, 'kos_current_process'
|
||||
@ -884,12 +884,14 @@ endp
|
||||
|
||||
pubsym skin_udata
|
||||
proc idle uses ebx esi edi
|
||||
extrn "pause", 0, libc_pause
|
||||
sti
|
||||
@@:
|
||||
mov [idle_scheduled], 1
|
||||
sfence
|
||||
if ~ HOST eq windows
|
||||
extrn "pause", 0, libc_pause
|
||||
call libc_pause
|
||||
end if
|
||||
jmp @b
|
||||
|
||||
ret
|
||||
|
Loading…
Reference in New Issue
Block a user