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

Self-made keyboard interrupt handler

I try to write my own keyboard interrupt handler (DOS is used), which only writes a message on the screen. When keyboard is not pressed, there another message is printed without end (so there is no way to stop program normally, but it doesn't…
Jack D.
  • 33
  • 4
0
votes
1 answer

Summing up a property form an array of realm object in swift

There are tow realm object class one is Entry and other is Work. The model scenario is looks like below.the Entry class is open class Entry: Object { dynamic open var date = Entry.defaultDate() dynamic open var quantity = 0.0 dynamic open var…
MD. Rejaul Hasan
  • 168
  • 1
  • 15
0
votes
0 answers

Switching to (un)real mode, reading disk and switching back to protected mode

My question is quite a bit theoretical, but I want to implement disk r/w to my Operating system, while I know how to do it in protected mode, it would take too long to implement ATAPI+ATA+FDC drivers (to make my OS boot on any device). I took two…
Kamila Szewczyk
  • 1,874
  • 1
  • 16
  • 33
0
votes
0 answers

Loading pointer to different segment in 16-bit assembly using gcc

I am writing 16-bit real mode assembly code that uses BIOS routines to dump a memory buffer to disk. I can't seem to figure out the syntax to get the segment register set correctly when setting up the pointer to the data buffer to be dumped. (I'm…
Zack
  • 6,232
  • 8
  • 38
  • 68
0
votes
1 answer

kernel in c inline assembly

Hi i have once again a problem i try to write a kernel with the GNU assembly language but i have some trouble. My kernel file versuch.c look like that: void kprintf( char hello[]) { /*char* video=(char*)0xb8000; for(int…
albert
  • 113
  • 1
  • 12
0
votes
1 answer

How to return in assembler in REAL mode to 32-bit address?

This code works in real mode. I have such example: This code goes to 0x001FFD50 address. ... 001F066F: push es 001F0670: push 0FD50 001F0673: retf ^^^^^^ 001F0674: push 00051 ... After that, I have such code: I need to get back…
user3360601
  • 327
  • 3
  • 17
0
votes
1 answer

Protect BIOS from very aggressive program

For the sake of experiment, I plan to run program X in realmode. Program X will make a random routine, and execute it (I want to see what will happen). But I worry that this program eventually damages the BIOS permanently. Is there a way to protect…
poem x86
  • 23
  • 2
0
votes
1 answer

Stack memory layout in 16 bit real mode

I'm playing with real mode bare metal programming using NASM and qemu. I'm trying to understand how stack works and in particular how it's stored in memory. My code is in a 512 byte boot sector with "magic byte" 0xaa55 at the end and it is loaded at…
EmarJ
  • 186
  • 1
  • 12
0
votes
0 answers

Can we use clob with Realm?

New to Android and realm, I have heard a lot about using realm at the place of SQLite, But I want to store documents in Database. So Can we do it with Realm if yes then how can we do it?
Bat
  • 135
  • 2
  • 9
0
votes
1 answer

Bootloader stack set up

I am currently trying to understand a certain piece of code. I found here: http://mikeos.sourceforge.net/write-your-own-os.html Specifically the first 2 lines under the start label: BITS 16 start: mov ax, 07C0h ; Set up 4K stack…
Forivin
  • 14,780
  • 27
  • 106
  • 199
0
votes
1 answer

How to use ORG addresses > 0xFFFF?

I am trying to write a simply bootloader in assembler. The bootloader copies sector 2 from a floppy to address 0x5000 (segment 0x500, offset 0x0), jumps to the segment and prints a message. However, when I change the segment address to 0x1000, the…
MechMK1
  • 3,278
  • 7
  • 37
  • 55
0
votes
0 answers

Filling four bytes with one loop in 16 bit assembly

im a begginner at os developing, so i started devloping in real mode 16 bits. assuming i decalre 4 bytes one after another by the following opreations: temp1 db 0 temp2 db 0 temp3 db 0 temp4 db 0 I want to fill all of them with input to the…
Circel
  • 1
0
votes
2 answers

Difficulties with extended assembly syntax to call a bios service in real mode

I am programming a boot loader, the boot sector has already handed over to the second stage. From now on, I am programming in C instead of programming everything in x86 assembly. My final goal is to make something simpler than u-boot but something…
Matthieu
  • 3
  • 2
0
votes
0 answers

int 0x13, ah = 0x08, Get drive parameters

I am trying to write a simple command system in x86 to run simple .COM files. This command system is designed to boot from a 720KB floppy. Here is the code: [BITS 16] [ORG 0x0000] mov ax, cs mov ds, ax mov [drive_num], dl mov [root_drive],…
RainingComputers
  • 554
  • 6
  • 17
0
votes
1 answer

Finding a new line

I'm new to assembly and my task is to read a file's name and print the even lines from this file. I don't know how to find a new line. I understand I have to cmp 13 and 10 because that's the carriage return, but I was unsuccessfully. Any help will…