295 questions
0
votes
1
answer
30
views
How Do You Retrieve a Video Output's Preferred Resolution? (BIOS Bootloader)
I am building an operating system for the x86_64 ISA. I am to the point in my development where I want to begin to display things graphically for the user, and therefore wish to retrieve the monitor/...
Advice
0
votes
7
replies
68
views
How Do You Retrieve a Video Output's Preferred Resolution?
Re-asked as a normal question (not opinion-based / discussion) as
How Does One Retrieve a Video Output's Preferred Resolution?
This version should be deleted.
3
votes
1
answer
164
views
Why does this code save registers before interrupts which don't destroy these registers?
I have been reading MS-DOS 1.00 source code. Link: https://www.pagetable.com/?p=165
One of the times where the developer decided to save a register, that is preserved by BIOS?
print xor ...
Advice
0
votes
2
replies
81
views
I want to write a basic MS DOS clone
I found the source code for ms dos 1.00 on the internet which only has bootloader and ibmbio.com/io.sys disassembled
So I have some questions.
Is it difficult to write a real mode OS similar to this ...
0
votes
2
answers
182
views
CPU Mode switches in qemu emulated machine. Undefined behavior. 16 bit code gets executed as 32 bit mode after a far jump
https://github.com/PoutineSyropErable/MapleKernel
The BareBones dir.
debug2 branch.
e5cf6d69e3f9f053 commit hash.
How is a proper 32PM -> 16RM mode switch done on modern x86_64? My 16 bit code is ...
1
vote
0
answers
78
views
Following the very first far jump instruction in early BIOS execution
How are CPU far jump instructions handled? What I mean to ask specifically is, what determines where the next instruction after the far jump is fetched from? I'm asking this in a context of the very ...
2
votes
2
answers
160
views
16-bit x86 Assembly Kernel getting stuck when calling input function
Well, I'm writing my own OS just for fun, and I thought it would have been cool to add a bytecode "language" interpreted by the kernel itself. I took inspiration mainly from Java, which is ...
2
votes
1
answer
60
views
Register corruption when iterating in a nested loop
It's my first time writing x86-16 assembly. I'm writing a bootloader game, but I'm struggling with iterating through level data.
I'm attempting to iterate through a 2d array - each byte of this array ...
2
votes
1
answer
104
views
Performing multiplication of 32-bit numbers in 16-bit real mode in order to traverse FAT table
I am writing a simple bootloader (and, hopefully soon, an operating system). I have been making progress, but this part is stumping me a bit.
I am writing this operating system and bootloader into a ...
0
votes
0
answers
71
views
DOS int 21h / AH=09h is outputting the contents of my NASM source file to the console, not the desired string
I'm working in NASM, for DOSBox, in 16-bit real mode. At 15th line, I trying to output field_separator string, but get my .asm file content. I suspect that I'm using the wrong register, or that I've ...
2
votes
0
answers
217
views
Can we switch from 64-bit ia-32e mode back to 16-bit real mode step by step on x86 processor?
As we all know, we can use assembly code to make the x86 CPU that supports ia-32e mode step by step from the real mode to protected mode and then to ia-32e (64-bit mode).
However, many articles on the ...
0
votes
1
answer
163
views
LBA 24-Bit Read Issue with I/O Port 0x1F0 : QEMU [UPDATED - SOLVED -CONTINUOUS THREAD]
General Backstory:
I am utilizing NASM 2.15.05 real-mode instructions with qemu-system-x86_64 as my current virtual machine for software debugging and serial output.
I have generated a disk image of ...
4
votes
0
answers
81
views
Does switching back to real mode switches back the addessing mode?
I have a boot sector that does the following, tested as a floppy in qemu-system-i386:
.code16
movw $0xd00, %bx ## machine code: 0xbb 0x00 0x0d
*Switch to Protected mode here, ...
1
vote
0
answers
152
views
memory allocation in real mode in the MBR
In a MBR, the following code in the preboot environment allocates a buffer of 10Kb by subtracting 10h from the total amount available :
seg000:7C1D sub word ptr ds:413h, 10h
seg000:7C22 mov ax, ds:...
0
votes
1
answer
166
views
Where are real mode address contents located in protected mode?
In real mode, an x86 CPU can only see address space that ranges 0x00000 to 0xFFFFF. MBR code is loaded into 0x07C00 by the BIOS. If that MBR code immediately switched into protected mode, where in the ...