Initialize default boot vars from umka_init

This commit is contained in:
Ivan Baravy 2023-02-12 19:02:31 +00:00
parent 905628d96d
commit cbcb3e1ddb
5 changed files with 14 additions and 20 deletions

View File

@ -89,6 +89,10 @@ UMKA_OS = 3
UMKA_MEMORY_BYTES = 256 SHL 20
UMKA_BOOT_DEFAULT_DISPLAY_BPP = 32
UMKA_BOOT_DEFAULT_DISPLAY_WIDTH = 400
UMKA_BOOT_DEFAULT_DISPLAY_HEIGHT = 300
public idle_reached
pubsym irq_serv.irq_10, 'kos_irq_serv_irq10'
pubsym idts, 'kos_idts'
@ -586,6 +590,14 @@ ends
proc umka_init c uses ebx esi edi ebp, _running
call umka._.check_alignment
; init boot vars
mov eax, BOOT
mov [eax + boot_data.x_res], UMKA_BOOT_DEFAULT_DISPLAY_WIDTH
mov [eax + boot_data.y_res], UMKA_BOOT_DEFAULT_DISPLAY_HEIGHT
mov [eax + boot_data.bpp], UMKA_BOOT_DEFAULT_DISPLAY_BPP
mov [eax + boot_data.pitch], UMKA_BOOT_DEFAULT_DISPLAY_BPP * \
UMKA_BOOT_DEFAULT_DISPLAY_WIDTH / 8
; init umka context
mov eax, umka
mov [eax+umka_ctx.booted], 0
mov ecx, [_running]

4
umka.h
View File

@ -43,10 +43,6 @@ struct umka_ctx {
atomic_int running;
};
#define UMKA_DEFAULT_DISPLAY_BPP 32
#define UMKA_DEFAULT_DISPLAY_WIDTH 400
#define UMKA_DEFAULT_DISPLAY_HEIGHT 300
#define KEYBOARD_MODE_ASCII 0
#define KEYBOARD_MODE_SCANCODES 1

View File

@ -167,14 +167,10 @@ main(int argc, char *argv[]) {
exit(1);
}
kos_boot.bpp = UMKA_DEFAULT_DISPLAY_BPP;
kos_boot.x_res = UMKA_DEFAULT_DISPLAY_WIDTH;
kos_boot.y_res = UMKA_DEFAULT_DISPLAY_HEIGHT;
kos_boot.pitch = UMKA_DEFAULT_DISPLAY_WIDTH * UMKA_DEFAULT_DISPLAY_BPP / 8;
struct umka_fuse_ctx *ctx = umka_fuse_init();
umka_boot();
struct vdisk *umka_disk = vdisk_init(argv[2], 1, 0u, 0);
struct vdisk *umka_disk = vdisk_init(argv[2], 1, 0u, ctx->io);
disk_t *disk = disk_add(&umka_disk->diskfunc, "hd0", umka_disk, 0);
disk_media_changed(disk, 1);
return fuse_main(argc-1, argv, &umka_oper, ctx);

View File

@ -353,11 +353,6 @@ main(int argc, char *argv[]) {
}
memset((void*)app_ldr, 0, APP_MAX_MEM_SIZE);
kos_boot.bpp = UMKA_DEFAULT_DISPLAY_BPP;
kos_boot.x_res = UMKA_DEFAULT_DISPLAY_WIDTH;
kos_boot.y_res = UMKA_DEFAULT_DISPLAY_HEIGHT;
kos_boot.pitch = UMKA_DEFAULT_DISPLAY_WIDTH * UMKA_DEFAULT_DISPLAY_BPP / 8;
run_test(os->shell);
os->shell->fin = fin;
clearerr(stdin); // reset feof

View File

@ -75,11 +75,6 @@ main(int argc, char **argv) {
kos_boot.memmap_blocks[1] = (e820entry_t){(uintptr_t)mem1, 128*1024*1024, 1};
kos_boot.memmap_blocks[2] = (e820entry_t){(uintptr_t)mem2, 256*1024*1024, 1};
*/
kos_boot.bpp = UMKA_DEFAULT_DISPLAY_BPP;
kos_boot.x_res = UMKA_DEFAULT_DISPLAY_WIDTH;
kos_boot.y_res = UMKA_DEFAULT_DISPLAY_HEIGHT;
kos_boot.pitch = UMKA_DEFAULT_DISPLAY_WIDTH * UMKA_DEFAULT_DISPLAY_BPP / 8;
int reproducible = 0;
struct optparse options;