real-mode

BIOS int 0x13 modifies CS:IP?

陌路散爱 提交于 2021-02-10 15:46:55
问题 I'm writing an x86 bootloader which occupies two sections (1024 bytes) on disk and the first thing I want it to do is to load both sections to segment 0x60 before continuing execution Here is the relocation part of my code: _start: // relocate and load remaining bootloader code mov $0x60, %ax mov %ax, %es mov $0x02, %ah mov $2, %al xor %bx, %bx mov $0, %ch mov $2, %cl xor %dh, %dh int $0x13 jmp $0x60, $reloc_done reloc_done: // set up segment registers mov $0x60, %ax mov %ax, %ds mov %ax, %es

Is it possible to have paging enabled in real mode?

空扰寡人 提交于 2021-02-10 07:15:23
问题 Is it possible to have paging enabled in real mode, for example during BIOS execution. If it is enabled what is the use of having paging in real mode 回答1: No , From Intel Manual Vol 3A Chapter 2.5 Paging (bit 31 of CR0) — Enables paging when set; disables paging when clear. When paging is disabled, all linear addresses are treated as physical addresses. The PG flag has no effect if the PE flag (bit 0 of register CR0) is not also set ; setting the PG flag when the PE flag is clear causes a

How to write to screen with video memory address 0xb8000 from real mode?

巧了我就是萌 提交于 2021-02-06 20:02:53
问题 I created simple code to load second sector from hard drive, and then write to whole screen, with spaces with red background. The problem is that always instead of spaces I got @ signs. This is the code: org 0x7C00 bits 16 xor ax,ax mov ds,ax mov es,ax mov bx,0x8000 cli mov ss,bx mov sp,ax sti cld clc xor ah,ah int 0x13 mov bx,0x07E0 mov es,bx xor bx,bx mov ah,0x2 ;function mov al,0x5 ;sectors to read mov ch,0x0 ;track mov cl,0x2 ;sector mov dh,0x0 ;head int 0x13 ;jc error ;mov ah, [0x7E00]

What is causing this bootloader to fail on hardware but not in DOSBOX? It displays all registers

时光毁灭记忆、已成空白 提交于 2020-12-11 08:53:29
问题 I recently wrote an x86 'bootloader' program that shows the values of the hardware registers after the BIOS jumps to my program. For the purpose of testing, I set the AX register to a known value to ensure that the program runs correctly. BITS 16 %macro pad 1-2 0 times %1 - ($ - $$) db %2 %endmacro [org 0x7C00] CLD ; clear direction flag (forward direction) CLI ; clear interrupt flag (disable interrupts, opposite of 65xx) MOV [0x8000], AX ; display all registers, MOV [0x8004], BX ; including

How to get segment memory address, when i have physical address?

核能气质少年 提交于 2020-07-16 07:01:34
问题 The physical address of the memory cell is given in the form 1A32H. What is the address of the beginning of the memory segment. Or more exactly, the seg:off address I should use to access it. Can someone explain me step by step how to solve this problem? 回答1: In x86 real-mode, the physical address is calculated as: 16 * segment + offset So the physical address 1A32H can be accessed in different ways: Segment = 1A3H, Offset = 2 or Segment = 1A2H, Offset = 12H or Segment = 1A1H, Offset = 22H or

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

橙三吉。 提交于 2020-05-09 08:07:29
问题 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. 回答1: IAPX88 physical addresses are computed by taking the segment register, shifting it to the left 4 bits, and adding the offset register. For example, the physical address in memory that code executes is (CS<<4)+IP where CS is the Code Segment and IP is the Instruction Pointer. You can get details on the Intel 8086 wikipedia page.

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

戏子无情 提交于 2020-01-21 11:33:58
问题 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 interrupt would clean the screen but it only seems to change the colour of the first line to grey. Thanks to anyone who can explain why this is not working. 回答1: The problem is that int 0x10 function 0x07 takes more parameters than you've given. Specifically, AH = 07 = scroll

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

守給你的承諾、 提交于 2020-01-21 11:33:50
问题 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 interrupt would clean the screen but it only seems to change the colour of the first line to grey. Thanks to anyone who can explain why this is not working. 回答1: The problem is that int 0x10 function 0x07 takes more parameters than you've given. Specifically, AH = 07 = scroll

Segment size in x86 real mode

笑着哭i 提交于 2020-01-09 05:30:06
问题 I have one doubt regarding the size of segments in real mode as they can't be more than 64K but can be less than that. My question is how these segment size and base address is initialized ? Like there are GDT's and LDT's in protected mode.Real mode segments can also overlapped,disjoint or adjacent.Like BIOS has some reserved area for specific things like boot code,video buffer etc does assembly programs need to do something like that ? 回答1: In real mode segmented addresses are hardwired into