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

bootloader reading drive parameters

I want to get dimensions of hard drive. I find that I need to use int 13h with ah = 08h. I found on wikipedia that it returns following: DH logical last index of heads = number_of - 1 (because index starts with 0) CX [7:6] [15:8] logical last…
vakus
  • 732
  • 1
  • 10
  • 24
1
vote
2 answers

Pointer to .text in real mode assembly

There must be something fundamental I'm misunderstanding about real mode addressing. I am trying to set up a function to print text via BIOS interrupt in real mode. I am testing the code using a .com file executed under DOSBox. The .text section…
KSquared
  • 58
  • 7
1
vote
1 answer

bootsector compare always wrong

After you helped me with hlt instruction (I forgot about clear interrupts cli), I found another problem. The compare always clear carry flag whatever buffer is equal or not to right password, in effect the password always is wrong. The problem is…
vakus
  • 732
  • 1
  • 10
  • 24
1
vote
1 answer

Int 13h isn't working on QEMU. The program crashes

I'm following a step by step introduction onto building a operating system from stratch. I can post the pdf if someone ask. So, I have this "disk_load" call which doesn't work for no aparent reason. I've checked every single parameter many times and…
Victor
  • 319
  • 2
  • 10
1
vote
1 answer

Where is a list of I/O ports used in real-mode code?

I am looking at some existing real-mode code that uses the in and out assembly instruction. I recognize a few, but I don't know what most of the different ports in the instructions are related to. Is there a list of what the different I/O ports…
samoz
  • 56,849
  • 55
  • 141
  • 195
1
vote
4 answers

physical address formula in 16 bit real mode: why multiply segment by 16?

physical address=16*selector+offset but i don't know why multiplying 16 by selector?
sia
  • 401
  • 3
  • 8
  • 20
1
vote
1 answer

Limitations of real mode as it pertains to device driver development

My query is regarding device driver development. If I wish to use real mode to make a Toy OS, but decide to write a network stack/set of network drivers, is there enough room to do so? Will I need to do like DOS and swap to Protected Mode to…
1
vote
1 answer

Kernel Dev: Setting ES:DI in real mode

I'm working on a toy kernel for fun and education (not a class project). I'm starting work on my memory manager, so I'm trying to get the memory map from BIOS using an INT 0x15, EAX=E820 call while still in Real Mode. I'm adapting my function from…
zrneely
  • 1,802
  • 3
  • 17
  • 26
1
vote
2 answers

Why my Realm database is so large?

The image below shows all my Realm classes and datas, but it is larger than 300MB. I implement a save method for each RLMObject, will it case the problem? - (void)save{ RLMRealm *realm = [RLMRealm defaultRealm]; [realm…
drinking
  • 1,533
  • 3
  • 15
  • 22
1
vote
2 answers

Real Mode 32-bit registers

I'm writing some Real Mode code and using 32 bit registers to do so (using the 0x66 prefix). I've been looking through Intel's manuals, and cannot find the information I am looking for. See:…
James
  • 1,569
  • 10
  • 18
1
vote
2 answers

How to make 20 bit address by using two 16 bit registers?

IAPX88 can deal with 1 mega byte memory(20 bit addressing), now my question is how we make a 20 bit address by using two 16 bit registers.please give an example.
Zia ur Rahman
  • 1,411
  • 4
  • 26
  • 43
1
vote
1 answer

Change text color/colour in 16 bit real mode assembly using int 0x10 and ax = 0x07

I noticed when using the 0x07 (scroll/clear screen) function in 0x07 that there is an attribute for screen colour (in bh). I noticed that help color listed all these colours so I changed what was originally 0x07 (white on black) to 0x0a (green on…
icedvariables
  • 99
  • 1
  • 9
1
vote
0 answers

Can't move cursor to the next line in Assembly Operating System using BIOS interrupts

I'm making a simple 16-bit real mode operating system and I've written the code below to move the cursor to the next line but it only moves down a line once despite the fact that it is called multiple times with and without other commands in…
icedvariables
  • 99
  • 1
  • 9
1
vote
0 answers

BIOS INT 0x13 function 8

Im' trying to get USB drive parameters using BIOS interrupt 0x13 function 8 in x86 real mode. I need the number of heads per track (HPC parameter). What values do I pass to registers and in which registers are the results stored? Are there any…
1
vote
1 answer

Segment Offset Pair bs Segment Descripter

I am little confused to understand the difference between a segment offset pair in 8088 for physical address calculation as compared to segment descriptors in 32 bit processor. Any explanation would be highly appreciated.