Questions tagged [real-mode]

x86 real mode is where a CPU begins execution. It has a 20-bit memory address space and unlimited direct software access to all addressable memory, I/O addresses and peripheral hardware. It has no concept of virtual memory, paging or memory protection as in protected-mode and long-mode. Use this tag for programming questions related to real mode.

Real mode, also called real address mode, is an operating mode of all x86-compatible CPUs.

Real mode is characterized by

  • a 20-bit segmented memory address space (giving exactly 1 MiB of addressable memory) and
  • unlimited direct software access to all addressable memory, I/O addresses and peripheral hardware, it
  • provides no support for memory protection, multitasking, or code privilege levels.

Before the release of the 80286, which introduced real mode was the only available mode for x86 CPUs. In the interests of backwards compatibility, all x86 CPUs start in real mode when reset, though its possible to emulate real mode on other systems when starting on other modes.

281 questions
2
votes
1 answer

How can I print the pressed keyboard key in Assembly bootloader?

I have created a small boot-able OS in Assembly, with Flat Assembler. I call it PulsarOS. However, I want to create a typing program for it. Like I said, it's all in x86 Assembly. I want it simply to where the user can type, and the typed text is…
2
votes
1 answer

Assembly translating ASCII character to HEX value

I was modifying code that suppose to translate ASCII characters to hexadecimal values. My first version was working perfectly without any problems, however my newer function have some problems. This is my new function which translates ASCII values…
vakus
  • 732
  • 1
  • 10
  • 24
2
votes
0 answers

Code works on bochs but does not on real computer, x86 real mode

This small piece of code works fine on bochs 2.6, but doesn't seem to work on 'real' computers (I've tried several of them). It seems like lodsb is causing the problem, since it worked fine, when I did hello world by printing the string "manually"…
2
votes
1 answer

My operating system doesn't boot in VMWare

I am making an operating system called TriangleOS with a few files like sysldr.sys, kernel.sys, etc. When I run it on VMWare I get this error: Remove disks or other media. Press any key to restart I'm compiling on Windows 10. I am using partcopy…
user4755019
2
votes
0 answers

Would 0x0900 be a good value for the stack segment?

I'm writing a tiny kernel for educational purposes and I was thinking of a good way to set up my stack in real-mode. I read from here: http://wiki.osdev.org/Memory_Map_%28x86%29 that addresses 0x07E00 to 0x7FFFF were guaranteed to be free for…
Matthew
  • 268
  • 1
  • 11
2
votes
1 answer

Diagnosing boot loader code in QEMU?

Diagnosing boot loader code in QEMU? I am trying to create a minimal 'boot loader code' that print the character 'A' and then halt. I wrote the following C++ program for the purpose #include #include #include int…
Andrew Au
  • 812
  • 7
  • 18
2
votes
0 answers

I need to intercept CR0 editing in real mode

I need to intercept CR0 editing in real mode and to execute my code before CPU enters in protected mode. Is it possible and if yes, how I can do this?
Still Dead
  • 61
  • 6
2
votes
0 answers

Write protect expansion ROM area

As per PCIe FW spec 3.0, BIOS will write protect the expansion ROM region once init vector is completed, but for a BIOS which has no UEFI support and running in 16 bit real mode how does it ensure write protection ?
Arka Sharma
  • 289
  • 1
  • 3
  • 10
2
votes
1 answer

x86 Switching to protected mode from real mode CPL (Current Privilege Level)

In x86, after we set the PE bit CR0, we do a far JMP to ensure that CS/EIP is changed. When I look at the logic flow in x86 programmers manual, corresponding to this far JMP instruction (protected mode), I see something like this: Set RPL field of…
Kamalakshi
  • 6,918
  • 3
  • 17
  • 21
2
votes
2 answers

How to reboot in x86 assembly from 16 bit real mode?

APM shutdown has been covered at X86 instructions to power off computer in real mode? How to reboot instead of shutting down the computer? Please quote and explain the relevant documentation / standard in your answer. I've understood that APM and…
Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
2
votes
3 answers

Why is that we can access only 1MB in 16bit real mode?

I can't understand why we can only access 1MB of memory in the 16bit real mode. Does the 1MB restriction denotes the memory access? I know that when a system starts we are limited to 16bit registers due to backward compatability, but why the…
prog481
  • 319
  • 1
  • 4
  • 12
2
votes
1 answer

Jumping to a far address in real mode

I have a situation where I have to jump to a far address in real mode, I have the segment value in fs register and offset in gs register, and during the jump I have to maintain the exact register content, I have come up with one idea as…
Arka Sharma
  • 289
  • 1
  • 3
  • 10
2
votes
1 answer

Address translation in big real mode

I have some questions regarding how address translation happens in big real mode, as http://wiki.osdev.org/Unreal_Mode says Unreal mode consist of breaking the '64Kb' limit of real mode segments, but still keeping 16 bits instruction and…
Arka Sharma
  • 289
  • 1
  • 3
  • 10
2
votes
1 answer

Is it possible to have paging enabled in real mode?

Is it possible to have paging enabled in real mode, for example during BIOS execution. If it is enabled what is the use of having paging in real mode
Arka Sharma
  • 289
  • 1
  • 3
  • 10
2
votes
2 answers

I failed in switching the cpu from real-mode to protected-mode

I do this according a book by Nick Blundell. I write a MBR program, which runs in real-mode firstly, and some instructions in the program will switch the cpu to protected-mode. First I set the GDT like this: gdt_start: gdt_null: dd 0x0 dd…
Akr
  • 179
  • 2
  • 4
  • 13