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
0
votes
0 answers

logical and physical adress in C code in real mode

Suppose I write boot loader on C. What happens when I create some global variable? What is it's logical address? How does it correspond to physical address? For example if I created some string (global) const char* s = "some string"; Am I right…
PepeHands
  • 1,368
  • 5
  • 20
  • 36
0
votes
1 answer

Writing the value of al - assembly - real mode - masm

I want to show the value of the register al without using any library, what should I do? Which interrupt should I use? I'm using assembly language (masm) and my program is in real mode. for example in protected mode we use Irvine32 library: mov bl ,…
H.sm
  • 5
  • 3
0
votes
2 answers

How to use real mode BIOS / VESA calls from GRUB?

I am developing a simple Grub module which would enable some additional video settings/initializations at the early stage of the boot process. My actual best idea would be to use some VESA calls for the task. Unfortunately, recently I've found real…
peterh
  • 11,875
  • 18
  • 85
  • 108
0
votes
2 answers

JMP not working

Okay, so I've been trying to make a two-step bootloader in assembly/C but I haven't been able to get the JMP working. At first I thought the read was failing, but, after the following test I ruled that out: __asm__ __volatile__( "xorw %ax,…
DividedByZero
  • 4,333
  • 2
  • 19
  • 33
0
votes
1 answer

Why cannot BIOS be written to run in protected mode?

Are there still 8088 based computers or pre-80286 computers in use? Why should this backward-compatibility feature of "first-starting-in-real-mode" be still present if those old processors are not in use anymore? Why cannot processors directly run…
Kamalakshi
  • 6,918
  • 3
  • 17
  • 21
0
votes
2 answers

Loading the Linux OS Kernel from BIOS

From book: After power-on, the CPU load the BIOS, build the interrupt vector table, and start interrupt service routines in real address mode. By BIOS, the CPU receives INT 0x19. The ISR of INT 0x19 loads the first sector (512B) into the memory.…
manav m-n
  • 11,136
  • 23
  • 74
  • 97
0
votes
1 answer

using ax instead of dx with interrupt 21

In the following code data segment ; add your data here! num db 0,0,0,0 sum db 0 str db "Sum is : $" ends stack segment dw 128 dup(0) ends code segment start: ; set segment registers: mov ax, data mov ds, ax …
uchar
  • 2,552
  • 4
  • 29
  • 50
0
votes
1 answer

How to compare strings in assembly?

I've looked at How to compare two strings assembly and I'm am trying to compare character by character until a character doesn't match and I can't seem to get my code to function how I want it to. I'm making a simple shell and I'm starting with the…
icedvariables
  • 99
  • 1
  • 9
0
votes
1 answer

How to temporarily store values in a row in assembly?

I'm making a 16-bit real mode operating system and I want to pass commands that the user types in. I can do input but I'm not sure how to store the resulting string so that it can later be parsed. Is there a better way than just putting each…
icedvariables
  • 99
  • 1
  • 9
0
votes
2 answers

How to convert normal bytes to ascii in assembly?

I am trying to write a function for my real mode operating system that will dump memory. I want the byte 0x0a to show up as '0A', 0xf3 to show up as 'F3' and so on and so forth. The code I wrote uses a table that consists of '0123456789ABCDEF', and…
Kpuonyer
  • 47
  • 1
  • 6
0
votes
2 answers

Reading boot Sector of the hard disk

I am trying to learn assembly in real mode .I wanted to read the boot sector of the hard disk ,So below is the code org 100h start: xor ax, ax mov es, ax ; ES <- 0 mov cx, 1 ; cylinder 0, sector 1 mov dx, 0080h ; DH = 0 (head), drive = 80h…
Amit Singh Tomar
  • 8,380
  • 27
  • 120
  • 199
0
votes
2 answers

i386 Real-mode. Some issues about loading data from memory

I'm just approaching to machine-level x86 coding, so please excuse the triviality of my question. The following code is intended to be a simple bootloader. It dumps some sector of floppy disk into memory and then it jumps to loaded code. In the…
mghis
  • 517
  • 1
  • 5
  • 14
0
votes
2 answers

Compiling real mode asm (rootkit.arsenal)

Im stuck on compiling the tsr.asm code provided in the book rootkit arsenal. I installed open watcom on a XP maschine and the first asm listing was compiled well. When compiling, it throws the error: "multiple starting address found" (nothing found…
-1
votes
1 answer

BIOS doesn't read the sectors

I write a 16bit operating system and currently I work on the disk reading. And the problem is the BIOS function ah = 2, int 0x13 raises an carry flag and reads 0 segments on the second read. After the faulty read ax is set to 0x2000, so 0 segments…
-1
votes
1 answer

When I call A ASM function in C the parameters don't appear on the stack

Ok so I have two files one is A C file and the other one is A ASM file. And their code is. C file void print() { print_char('A'); } ASM file print_char: push ebp ; prolouge mov ebp, esp mov ah, 0eh ; set code for printing mov al, [esp+8] ; move…
8_BIT
  • 29
  • 1
  • 5
1 2 3
18
19