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
3
votes
2 answers

Alter Interrupt in 16 bit Real Mode

I'm trying to alter my interrupt table to take over the keyboard interrupt. My end goal is to write my new interrupt routine, copy myself into RAM and make the real-mode interrupt table point to me. I have found random sample code online but it is…
Without Me It Just Aweso
  • 4,593
  • 10
  • 35
  • 53
2
votes
3 answers

How to switch to real mode in a linux driver

I've got an intel-based SBC that I'm using in an embedded application. It's got a Digital IO (DIO) port attached to a Fintek Super I/O chip. I want to be able to set the bits on the output lines of this port to control some other hardware. …
gct
  • 14,100
  • 15
  • 68
  • 107
2
votes
1 answer

Accessing intel graphics card registers through I/O space and MMIO in UEFI

I am trying to write a code sequence, that will switch my intel graphics card into the legacy VGA mode after a call to Exitbootservices() in my uefi nasm bootloader. In order to do that I am to change some values in my graphics card's registers. My…
adivanced
  • 31
  • 6
2
votes
1 answer

Not able to work offline in realm with .net sdk

My app is not able to work in offline mode after I disconnected the internet. When I debugged, it failed at line 49(plz visit the screenshot attached) as shown highlighted. Somehow it is getting the realm instance at line 48 even in offline mode,…
Arup
  • 155
  • 11
2
votes
1 answer

Call Int 13h in a ISR

I have written a ISR for int 9h by assembly in Real Mode. In this ISR, I call INT 13h, AH=0x02 for writing some data on Hard Disk. But data aren't written on Hard Disk. Also int 13h, ah=0x02 doesn't work too (Read data from Hard Disk). after call…
CoyBit
  • 1,592
  • 1
  • 17
  • 19
2
votes
1 answer

What happens if we request multibyte data at the end of memory address?

I am learning assembly language and has a question regarding this. I have a bootloader in real mode where we can access memory upto 1 mb. What will happen if we request 2 byte data at the end location of 1 mb space,will it return only one byte or…
2
votes
1 answer

What does "invalid command (error code 0x01)" mean within BIOS int 13

I'm working with a friend of mine on a simple bootloader, with no pretense of it becoming anything usable. After writing the on-screen input and output functions we moved on to writing the functions to read a sector from disk, and this is where the…
2
votes
1 answer

How can I read and store video memory in 8086 using C?

I'm writing a tiny OS for my homework and I want to preserve the contents displayed on shell (Because when I use shell to open another application, the screen will be covered by new contents of it, and I want to recover the shell just like before…
zjnyly
  • 189
  • 1
  • 11
2
votes
2 answers

What's under 0x400000 in virtual memory?

When learning Linux Operating Systems, I know the following things: Real mode will use addresss under 0x10000 Protected mode use 4G for 32bit, and the user space can use 2/3 G The virtual memory for a program will start from 0x40000 to higher So,…
tyChen
  • 1,404
  • 8
  • 27
2
votes
1 answer

Acessing $eip via gdb fails in real mode

I'm trying to debug an x86 bootloader I am writing using gdb. Since gdb doesn't seem to handle 16-bit real mode very well I am using a gdb script someone else wrote for this purpose. A minimal example of the code I'm trying to debug looks like this…
Peter
  • 2,919
  • 1
  • 16
  • 35
2
votes
1 answer

Relocating bootloader into EBDA?

For educational purposes, I am trying to write a simple x86 bootloader that boots a dummy OS from a floppy disk image. I am currently at the stage where I have gotten my bootloader to output "Hello world" via BIOS video interrupts. I would now like…
Peter
  • 2,919
  • 1
  • 16
  • 35
2
votes
1 answer

How to print "Hello World" in Assembly for DOS debug.exe

Why does this code did not display "Hello World" I am currently using Assembly language in dos box. This is my first time to code Assembly language. -a 073F:0100 jmp 126 073F:0102 db 0d, 0a, 'Hello, World!' 073F:0111 db 0d, 0a, '$' 073F:0114 xor ax,…
Kroi
  • 246
  • 3
  • 9
2
votes
0 answers

How can I run code higher than 0xffff in unreal mode?

I successfully wrote a program which unlocks the unreal mode (I can write to memory by mov byte [ebx] when ebx is bigger than 0xFFFF) but I don't know how to run code over the address 0xffff so that eip is bigger than that. When I use a jmp…
2
votes
1 answer

assembly emu8086 diagonal line

I need to draw an diagonal line on my square from the left side to the right i've already the square so i only need the diagonal line i'll leave my square code bellow and this question was not answered yet to emu8086. code: org 100h jmp…
2
votes
0 answers

Confusion of NULL selectors in 64bit processors

I'm sorry my English is not good. In protection mode, Out of segment limit will trigger #GP. But I have a strange problem on 64 bit processor(I7-3840,i5-3540): initialize DS or ES to 0 in real mode, then switch to protection mode, and still use the…
lgj1107
  • 21
  • 1
  • 2