I'm currently working on an operating system. I have written an interpreter (which is also a compiler, oddly enough, but that's not the point). I basically did everything; I just need to build a GUI. I wrote my own language for handling that too, but I can't access the whole screen, and when I try to, it crashes. The code looks like this:
...
mov ax,118h
mov bx,ax
mov ax,4f02h
int 16
(entering 64 bit)
(some of my language)
ou:
sub r11, 2 ;this is part of my brainfuck interpreter, it takes the 3 bytes of color of the current and previous two bytes.
mov al, [r11]
mov ah, 00000000b
mov edx, 1111111111111111b
mul edx
add eax, edx
inc eax
mov ax, 0000000000000000b
mov ecx, eax
inc r11
mov cl, [r11]
mov ch, cl
inc r11
mov cl, [r11]
jmp ouu
...
ouu:
;mov ecx, 00000000111111111111111110001000b (This is just for debugging)
mov rax, 1024
mul r8 ;y coordinate
add rax, rdx
add rax, r9 ;x coordinate
mov rdx, 3
mul rdx
add rax, rdx
mov rdi,rax
mov [0a0000h+rax], rcx
stosb
If you want to see the whole code, I can send it to you personally, but since nobody ever programmed a brainfuck OS and it's so compact (it's not even a kilobyte with everything), I want to be secretive with this till I finish it.
It currently has 24 bit graphics (real color), no push or pop, no BIOS after 16 bits, no kernel, and no C. It's the barest program you can ever write. And I'm trying to make it compatible with all resolutions (I mean, even with 8K). But I have to access the whole screen, and most people use C or some type of kernel, so I couldn't find an answer to do this. So basically, I need to do pageing. Can somebody help with my crazy project?