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

What is the best way to clear the screen in 32-bit x86 assembly language (Video mode 13h)

So at the moment i am copying a screenbuffer (screenbuffer db 64000 DUP(0)) to the video memory (which starts at 0a0000h) to clear the screen. But i was wondering if it is better to just setup the video mode again like this: mov ax, 13h int…
T Snake
  • 89
  • 1
  • 8
5
votes
1 answer

What does ASSUME mean in assembler?

Everywhere it is explained as a thing which binds/associates registers with segments, but I want to understand what is bound exactly.
5
votes
1 answer

Where to place the stack and load the kernel

I'm new to operating system development and I'm curious about a problem I've run into while developing my own bootloader. My operating system is going to be written in assembly and will run in 16-bit real mode. I know what the stack is and I have…
DrCereal
  • 85
  • 8
5
votes
1 answer

Displaying text video memory at 0xb8000 without using the C library

I have been writing kernel in C. I've been using the GCC cross-compiler, writing on a Windows system and targeting 16bit Real Mode. I don't have the C library available to write the kernel. I have started with some code which is suppose to print a…
Panther Coder
  • 1,058
  • 1
  • 16
  • 43
5
votes
1 answer

Loading second stage of a bootloader

I'm trying to create a small operating system for x86 machines and started writing the code for a fairly minimal bootloader. The bootloader I created is quite simple, it loads a small second bootloader from the sector located directly after the…
Shadowwolf
  • 973
  • 5
  • 13
5
votes
2 answers

bootloader - load 2nd stage - qemu works, real machine doesn't

As a learning exercise, I wrote a little 16 bit bootloader for x86 bios systems. It seemed to work fine on QEMU. I dd'ed it to a drive for an old amd-turion computer (x86_64), and when I tried to boot that computer, it would do the BIOS screen,…
James M. Lay
  • 2,270
  • 25
  • 33
5
votes
1 answer

Can't clear entire screen in 16-bit real mode Assembly

I'm trying to clear the screen in my simple 16-bit real mode operating system. Below is the code: clearScreen: pusha mov ah, 0x7 mov al, 0 int 0x10 popa ret I read that setting al to 0 and calling the scroll screen…
icedvariables
  • 99
  • 1
  • 9
5
votes
1 answer

Is there a standard BIOS Int 10h video mode for 43 lines or more?

I'm writing code which runs in real mode before any OS is loaded. Part of my program involves a dump of information to the video display, and the standard 80x25 text mode is not cutting it. Many versions of Windows and other OSes seem to have no…
Kevin
  • 1,179
  • 7
  • 18
5
votes
1 answer

USB Control in x86 Real Mode

I'm working on a raw, x86 real-mode USB access project. This involves a custom bootsector, 2nd stage bootloader, and some trivial hardware drivers. End goal is to provide a product that boots, sends data over USB interface, receives data over USB…
4
votes
3 answers

Is it possible to shutdown linux kernel and resume in Real Mode?

Let's say I'd like to start a small linux distro before my ordinary operating system start. BIOS load MBR and execute MBR. MBR locates the active partition which is my linux partition. Linux start and I perform what I need to do. Linux shut down…
Jonas Engström
  • 5,015
  • 3
  • 37
  • 36
4
votes
1 answer

Why isn't INT 31H set up properly even with a DPMI host active?

I've been doing a lot of experimenting with assembly programming in MS-DOS. I've read that Windows 3.1 acts as a DPMI host for DOS programs, and that DPMI uses interrupt 31h for function calls. So let's give that a try. I open a DOS prompt in…
flarn2006
  • 1,787
  • 15
  • 37
4
votes
2 answers

How can I determine the result in AX after MOV and LEA instructions

I am trying to understand what will be the content of AX register in the following question, I don't understand how I can know what [5000h] or [DI] is in the examples. The state of the registers and memory are defined as: CS=3000 [53000]=BBBB…
Amitay Tsinis
  • 320
  • 3
  • 12
4
votes
1 answer

Understanding of boot loader assembly code and memory locations

I want to check my understanding of the following bootloader code: BITS 16 start: mov ax, 07C0h ; Set up 4K stack space after this bootloader add ax, 288 ; (4096 + 512) / 16 bytes per paragraph mov ss, ax mov sp, 4096 mov…
supmethods
  • 525
  • 6
  • 18
4
votes
1 answer

Why does the register in x86-assembly (r)si get moved into itself if I try to point it to a label?

I want to write a bootloader, which simply prints "Hello World!" on the screen and I don't know why my bytes get mixed up. I'm trying to write it in AT&T syntax (please don't recommend Intel syntax) and trying to convert the code from this tutorial…
Keya Kersting
  • 135
  • 1
  • 1
  • 8
4
votes
1 answer

What is/was the meaning of the __loadds keyword in C compilers for x86 real mode?

I've run into the __loadds keyword as a function declaration modifier in some old code for 16-bit Windows that I was looking at out of curiosity. A Google search did not yield anything useful, presumably because no one uses the compilers that…
Govind Parmar
  • 20,656
  • 7
  • 53
  • 85
1 2
3
18 19