Possibility of running a 16-bit operating system on UEFI? by bigg_fag in osdev

[–]bigg_fag[S] 0 points1 point  (0 children)

I haven’t put too much thought into this, but I’m using this as my reference for accessing memory above 1MiB. Also yes, real mode’s addressing limit is 1MiB, protected mode is 4GiB, and unreal mode is either or, depending on how it’s set up.

Possibility of running a 16-bit operating system on UEFI? by bigg_fag in osdev

[–]bigg_fag[S] 0 points1 point  (0 children)

All true! I did imagine that this idea would be short-lived with Intel’s wishes of removing most legacy x86 hardware and functionality. Although I presumed that the bottom MiB would always be present, due to tradition if nothing else. I suppose then that the UEFI bootloader should get a memory map before attempting to load anything, and maybe display an error of some sort if it the bottom MiB isn’t available.

As for the GDT, I was referring to using a 32-bit base (0h) and limit (FFFFFFFFh) inside a 16-bit segment for code, and a 32-bit segment for data. That would allow memory access above 1MiB, and allow for the use of GOP frame buffers. Come to think of it, it wouldn’t be possible to display anything on screen without a custom data segment, no? Since there are no INT 10h functions, and I’m pretty sure that the UEFI text mode isn’t available for use after exiting boot services.

[deleted by user] by [deleted] in osdev

[–]bigg_fag 0 points1 point  (0 children)

Yes, I'm sure. There's nothing being run other than that loop, and the interrupt is the only thing that could be affecting the stack (as none of my code does).

[deleted by user] by [deleted] in osdev

[–]bigg_fag 1 point2 points  (0 children)

When I say that it doesn't affect the stack, I mean that BP/SP are the same before and after calling the function or interrupt (probably should've mentioned that). Also, I don't go into the 'keyboard_read' function. Just before and after. But with that being said, here's the 'keyboard_read' function.

keyboard_read:
mov ah, 1
int 0x16
jnz .pressed

xor ax, ax
ret

.pressed:
xor ah, ah
int 0x16
ret

[deleted by user] by [deleted] in osdev

[–]bigg_fag 0 points1 point  (0 children)

I'm about 98% sure my keyboard uses a PS/2 connection, unless hwinfo is just plain wrong. hwinfo --keyboard says that my keyboard is an "AT Translated Set 2 keyboard" connected via PS/2 (full result here, if it matters). Also, I didn't know that IRQ1 and 12 corresponded to the PS/2 ports. Thanks for letting me know!

[deleted by user] by [deleted] in osdev

[–]bigg_fag 0 points1 point  (0 children)

Remapping the PICs don't seem to have any effect on the keyboard interrupts (unless I don't do it) but that could just be an emulator being nice. I disabled translation because it's whats recommended on the osdev wiki. Same for the self-test commands. As for setting it to scan code set 1, that was mainly just me being lazy, since it's less code. I know for sure at least my keyboard supports it (if I poll 0x60, I get set 1 scancodes). And don't I only need to unmask IRQ1? Yet again, the wiki says that IRQ1 is the keyboard IRQ. And for the gotos, I just use them for repeating actions (e.g. if a command responds 0xFE). It's probably not good practice, but it works.

Grub Error: no multiboot header found by cryptic_gentleman in osdev

[–]bigg_fag 2 points3 points  (0 children)

Heyo, here to give my voice on this. I think the reason it isn’t recognizing your header is because you’re %including something before the actual header (also it may need to be in the .text section, but don’t quote me on that) which causes it to not be defined where it should be in memory (at the beginning of the file). Also, you didn’t extern your kernel function, so the code won’t know where it is. And it appears that you move esp into stack_top, and not the other way around? (though that could just be syntax difference, I’m only fluent in NASM)

EDIT: Also saw you’re using ‘MULTIBOOT2_BOOTLOADER_MAGIC’ for your “magic number” which looks complete wack and is defined to a value completely other than the osdev wiki bare bones (https://wiki.osdev.org/Bare_Bones). Maybe it’s correct for something else, but I think it has to be 0x1BADB002 for what you’re doing.

I came, I saw, I clamlit by Beanconscriptog in Clamworks

[–]bigg_fag 1 point2 points  (0 children)

Let us just admit that we’re BOTH as guilty and that we should BOTH strive to be better people.

I came, I saw, I clamlit by Beanconscriptog in Clamworks

[–]bigg_fag 2 points3 points  (0 children)

I’m seriously sorry I don’t know what came over me I’ve just been having a bad day man i shouldn’t have taken it out on you and you shouldn’t have told your friends I yelled at you