这是否意味着引用的页面位于进程的逻辑地址空间内?我在想也许引用的页面是内存驻留的?
我会问如何在引导程序中获得总RAM大小和可用RAM大小.截至目前,我知道如何获得更低的内存.但由于某种原因,我无法将其打印到屏幕上,因为它保存在ax寄存器中.这是我到目前为止:
[BITS 16] ; BootLoader always starts 16 BIT Moded
jmp main_bootloader ; Jump to Main Bootloader
;************** INITALIZED VARIABLES *********************;
string db 'BoneOS Loading . . .', 0x0
string2 db 'Starting of 16Bit Bootloader' , 0x0
press_to_cont db 'Press any key to continue . . .' , 0x0
carry_flag_err db ' CARRY FLAG HAS BEEN SET! ERROR ' , 0x0
magic_number equ 0x534D4150
limit dw 0
base dw 0
low_memory dd 0
answer resb 64
;*********************************************************;
;******************** GDTs *****************************; …Run Code Online (Sandbox Code Playgroud) 我正在组装中构建一个32位操作系统.
我已经设置了IDT,我正在通过int指令处理程序interruptus .
如何启用syscall和sysenter说明以及如何处理/返回?
诚然,syscall指令在32位基于英特尔处理器的支持,所以我不能用它?sysret教学不安全是真的吗?在某处存在一个教程吗?
编辑:我的主要问题是如何启用syscall和sysenter说明!(没有重复)
assembly system-calls protected-mode osdev interrupt-handling
我正在编写一个操作系统并希望有 GUI。我找不到在屏幕上绘制像素的好教程。
我想要一些程序集 + C 示例,我可以在 BOCHS 或v86等模拟器上构建和运行它
我正在编写一个简单的 NASM 汇编引导扇区。该代码应在 16 位实模式下将文本打印到屏幕上,然后切换到 32 位保护模式并将文本打印到屏幕上。
我使用 QEMU 作为我的 CPU 模拟器,它按照应有的方式从 16 位模式打印文本。但是,在 32 位模式下应该打印的文本不会打印。
我认为这是我的代码的问题,但我也运行了类似的代码,同样的问题是仅在 16 位模式下工作。
是我没有正确使用 QEMU,还是我弄乱了其他东西?我的代码是:
引导扇区.asm
; Boot sector that enters 32 bit protected mode
[org 0x7c00]
mov bp, 0x9000 ; Set stack
mov sp, bp
mov bx, MSG_REAL_MODE
call print_string
call switch_to_pm ; We will never return to here
jmp $
%include "print_string.asm"
%include "gdt.asm"
%include "print_string_pm.asm"
%include "switch_to_pm.asm"
[bits 32]
;Where we arrive after switching to PM
BEGIN_PM:
mov ebx, …Run Code Online (Sandbox Code Playgroud) 我试图在实模式下绘制到屏幕,所以我试图使用分段访问 0xB8000
我的汇编代码是这样的
[BITS 16]
org 0x7c00
begin:
mov ah, 0x01 ; disable cursor
mov ch, 0x3f
int 0x10
mov ch, 0x0000
mov cs, 0xb800
mov ah, 0x0000
mov [cs:ah], ch ; invalid effective address
end:
jmp end
times 510 - ($-$$) db 0
dw 0xaa55
Run Code Online (Sandbox Code Playgroud)
我将如何正确使用分段来解决 0xB8000?
我正在开发一个简单的操作系统,并且遇到了一些输出闪烁的问题(请参阅此剪辑)。除了内存问题之外,我很不知道是什么原因造成的。
内核.cpp
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
#define FPS 30
#define PIT_HERTZ 1193131.666
#define CLOCK_HIT (int)(PIT_HERTZ/FPS)
const unsigned char font[128-32][8] = {
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0020 (space)
{ 0x18, 0x3C, 0x3C, 0x18, 0x18, 0x00, 0x18, 0x00}, // U+0021 (!)
{ 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // U+0022 (")
{ 0x36, 0x36, 0x7F, 0x36, 0x7F, 0x36, 0x36, 0x00}, // U+0023 (#)
{ 0x0C, 0x3E, 0x03, 0x1E, …Run Code Online (Sandbox Code Playgroud) 给定一个这样的压缩结构:
struct RSDPDescriptor {
char Signature[8];
uint8_t Checksum;
char OEMID[6];
uint8_t Revision;
uint32_t RsdtAddress;
} __attribute__ ((packed));
Run Code Online (Sandbox Code Playgroud)
如何将其中的所有单个字节相加?
我正在x86汇编中开发一个实模式操作系统。我设法用键盘移动了光标,但我想用鼠标移动了光标。我不知道 我发现int 33h处理鼠标,但是我似乎无法使用int 33h移动光标。
因此,我目前正在使用操作系统,并且处于非常愚蠢的状态:切换到VESA / VBE
我当前的代码:
mov ax, 0x4F02
mov bx, 0x4118
int 0x10
Run Code Online (Sandbox Code Playgroud)
它改变了Qemu分辨率,但是现在我在绘制像素时遇到了问题。像素偏移的公式为:
uint32 pixel_offset = y * pitch + (x * (bpp/8)) + framebuffer;
Run Code Online (Sandbox Code Playgroud)
问题是bpp,pitch和framebuffer应该由
mov ax, 0x4F01
int 0x10
Run Code Online (Sandbox Code Playgroud)
和
mov ax, 0x4F00
int 0x10
Run Code Online (Sandbox Code Playgroud)
第一,
mov ax, 0x4F00
int 0x10
Run Code Online (Sandbox Code Playgroud)
软锁qemu。即使没有,我该怎么做才能访问该信息。
我想要的是一个功能,该功能可以切换为完全用汇编语言(nasm)编写的VESA / VBE,然后可以使用我的内核编写的函数访问。
编辑:我真的不能在我的引导程序中包含任何C。我需要汇编代码。
osdev ×11
assembly ×7
x86 ×5
nasm ×3
bootloader ×2
c++ ×2
x86-16 ×2
multiboot ×1
page-tables ×1
qemu ×1
ram ×1
real-mode ×1
struct ×1
system-calls ×1
vesa ×1