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
1
vote
1 answer

near/far jmp/call specifics

I can't get full grip on specifics of far/near versions of jmp/call. As I understand near jmp/call instructions use relative offset from instruction itself as operand. Far jmp/call instructions use absolute address as operand. 1) In protected mode…
igntec
  • 1,006
  • 10
  • 24
1
vote
1 answer

What happens when we try to set the register of the currently executing code?

CodeProject has an article: CS always holds the segment of the currently executing code. You cannot set CS by using, say, mov cs,ax. When you call a function that resides in another segment (FAR call), or when you jump to another segment (FAR…
Pacerier
  • 86,231
  • 106
  • 366
  • 634
1
vote
2 answers

Real Mode Simple OS difficulty

I am writing a simple OS in real mode ASM for the fun of it. I have recently decided to move on to the filesystem. I assembled the code with nasm -f bin -o boot.o boot.asm nasm -f bin -o kernel.o kernel.asm nasm -f bin -o fs.o fs.asm dd if=boot.o…
Kpuonyer
  • 47
  • 1
  • 6
1
vote
2 answers

Are DS and CS overlapped in this code

I am learning programming in real mode and found a post here on SO which is quite useful for me But I have some doubts regarding how things are working in given code Basic NASM bootstrap ;This is NASM BITS 16 ; 16 bits! …
Amit Singh Tomar
  • 8,380
  • 27
  • 120
  • 199
1
vote
2 answers

Whats is wrong with this real mode code

I have got a piece of code which runs in realmode and printf a message on screen,I am using Dosbox 0.7 as my execution environment .Below is the code jmp 0x7c0:start start: mov ax, cs ; set up segments mov ds, ax mov es, ax mov al,03h mov…
Amit Singh Tomar
  • 8,380
  • 27
  • 120
  • 199
1
vote
1 answer

calculate logical address from physical address (x86)

As far as i know, the physical address is calculated by shifting the segment address (16-bit) left 4 times and adding it with the 16-bit offset address. My question is, what if 2 different sets of segment:offset address values give the same…
1
vote
2 answers

issues with div in TASM

I have a little problem with a div, i need some help with this problem, I have an application in TASM, I must find the multiple of 3 in a series of numbers, the problem is when i do a div the program freezes and i have no idea why. My code…
1
vote
3 answers

How to know that current mode is real or big real mode?

Suppose my API is to be called from a system which may work in real mode or big real mode only. My API is supposed to display the current system mode. Then how could it know whether the current mode is real mode or big real mode? Note: In Big real…
0
votes
1 answer

16bit Real Mode C Compiler for Mac OS X

I am looking for a C compiler that runs on mac and it needs to compile to 8086 16 bit real mode machine code.
user400055
0
votes
0 answers

Connect Boot and Kernel file

I started creating my first OS recently (I'm a complete beginner). I wanted to know how to connect the boot file with the kernel. I tried alone but I couldn't, how can I do? This is the project: boot.asm ORG 0x7C00 BITS 16 start: mov si,…
0
votes
0 answers

Retaining and Referencing linkers for paging passed 64kb in a standard BIOS

Today I am investigating more into linker files. I've been prototyping BIOS programs for many months now and I've mainly managed to run my models for debugging by ld commands For the longest time I had learned to use a template for ld in my Makefile…
0
votes
1 answer

x86 checking for protected and long mode in real mode

So I want to check if protected and long mode is supported while being in real mode. I know that I can check for support of long mode while being in protected mode, but that requires cpuid instruction which I don't think we have in real mode (at…
0
votes
1 answer

MongoDB Atlas Device sync can't select serverless cluster

Please help me. I have created a Serverless instance in MongoDB Atlas. now under device sync, I need to connect the cluster but when I try to select the cluster to sync it was disabled, could not select it. For your reference, I have attached the…
TechOverflow
  • 117
  • 9
0
votes
1 answer

stored string in stack gets printed reversed in boot sector assembely code

i wrote a simple boot sector assembly program that pushes each character that is entered in keyboard to the stack but when i try to retrieve each character from top of the stack and print them as a whole the result is in reverse. i know im reading…
alireza
  • 33
  • 6
0
votes
1 answer

String Output in Real-Mode by using LODS instruction

I'm need to write function, which output a string in real-mode. There is that code: ;; ds:si - string address, cx - length of string cld putc: lods mov ah, 0x0E xor bh, bh int 0x10 ;; display character, advancing cursor…
SubtRose
  • 35
  • 3