我是操作系统开发的新手,我很好奇我在开发自己的bootloader时遇到的问题.我的操作系统将以汇编语言编写,并将以16位实模式运行.
我知道堆栈是什么,我的印象是它向下扩展到内存中.如果我错了,请纠正我.我知道如何从软盘中将基本内核加载到内存中,我不相信这是问题所在.
我遇到的问题是我不确定在哪里放置堆栈并将内核加载到内存中.我试过像这样创建我的堆栈,我遇到了问题:
mov ax, 0x0000
mov ss, ax
mov sp, 0xFFFF
Run Code Online (Sandbox Code Playgroud)
我正在加载我的内核0x1000:0x0000.当我推送并稍后在我的函数中弹出易失性寄存器时print,我的内核只是第二次挂起call print.这是我的print功能:
print:
push ax
push bx
push cx
mov al, [si]
cmp al, 0
je p_Done
cmp al, 9
je p_Tab
mov ah, 0xE
int 0x10
cmp al, 10
je p_NewLine
p_Return:
inc si
jmp print
p_Tab:
xor cx, cx
p_Tab_Repeat:
cmp cx, 8
je p_Return
mov ah, 0xE
mov al, " " …Run Code Online (Sandbox Code Playgroud) 使用 SQL SERVER 2012 版运行 ASP.NET C# 应用程序后,我收到以下错误消息:
本地报告处理期间发生错误。报告“C:\inetpub\wwwroot\psla\Reports\PD Listing Report - Per ED.rdlc”的定义无效。报表处理中发生意外错误。无法加载文件或程序集“Microsoft.SqlServer.Types, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91”或其依赖项之一。定位的程序集的清单定义与程序集引用不匹配。(来自 HRESULT 的异常:0x80131040)
可能是什么原因?我试过在网上搜索,并且有对 version=11.0.0.0 的引用,但没有对 version=12.0.0.0 的“Microsoft.SqlServer.Types”的引用。查看visual studio 2015的参考管理器,我只能找到版本= 11.0.0.0。
在我的application.yml中:
endpoints:
restart:
enabled: true
shutdown:
enabled: true
health:
sensitive: false
Run Code Online (Sandbox Code Playgroud)
但是当我要求/健康时,我总是得到:
{"status":"UP"}
Run Code Online (Sandbox Code Playgroud)
有什么想法获取更多信息吗?
以下从 32 位保护模式(启用 A20)转换到 64 位长模式的代码似乎给我带来了问题。我将 1GiB 页面从 0x00000000 恒等映射到 0x3fffffff;启用 PAE;启用 EFER MSR 中的长模式位;安装 GDT;启用分页;然后对我的 64 位入口点进行模拟 FAR JMP:
lea eax, [PML4]
mov cr3, eax
mov eax, cr4
or eax, 100000b
mov cr4, eax
mov ecx, 0xc0000080
rdmsr
or eax, 100000000b
wrmsr
mov eax, cr0
mov ebx, 0x1
shl ebx, 31
or eax, ebx
mov cr0, eax
call gdt64_install
push 8
push longmode
retf ;<===================== faults here
Run Code Online (Sandbox Code Playgroud)
当执行指令时,程序在BOCHSRETF中出现三次错误,但似乎没有返回任何错误。如果我info tab在这次跳转之前输入,我会得到:
0x00000000-0x3fffffff -> 0x000000000000-0x00003fffffff
Run Code Online (Sandbox Code Playgroud)
在我看来,分页正在工作。这是sreg …
是否允许单个访问跨越x86 1之间0和之间的边界?0xFFFFFF...
例如,假设eax(rax在64位中)为零,则允许以下访问:
mov ebx, DWORD [eax - 2]
Run Code Online (Sandbox Code Playgroud)
如果答案不同,我对x86(32位)和x86-64都很感兴趣.
1当然,鉴于该区域已在您的流程中映射等.
某些使用goto限定符的扩展汇编语句无法使用 GCC 10.1.0 进行编译。具体来说,
int foo(int count)
{
asm goto ("dec %0; jb %l[stop]"
: "+r" (count)
:
:
: stop);
return count;
stop:
return 0;
}
Run Code Online (Sandbox Code Playgroud)
(这是GCC 扩展 asm 文档中的一个示例)无法使用消息编译expected ‘:’ before string constant。删除"+r" (count)和dec %0允许它成功编译,但无论我在何时尝试在与 goto 标签相同的 asm 语句中提供输出操作数时,它都会以同样的方式出错。
当我使用它们获取地址时,mov和lea之间究竟有什么区别?
假设我有一个程序从第5个字符开始打印出一个字符串,其代码如下所示:
section .text
global _start
_start:
mov edx, 0x06 ;the length of msg from its 5th char to the last is 6.
lea ecx, [msg + 4]
mov ebx, 1
mov eax, 4
int 0x80
section .data
msg db '1234567890'
Run Code Online (Sandbox Code Playgroud)
然后,如果我换lea ecx, [msg + 4]了mov ecx, msg + 4,将它运行不同?
我试过两个,输出看起来是一样的.但是,我从这个链接中读到,LEA指令的目的是什么?,在第一个答案的评论部分,似乎有人声称有类似mov ecx, msg + 4无效的东西,但我没有看到它.有人能帮助我理解这个吗?提前致谢!
.386
.model flat, c
.stack 100h
printf PROTO arg1:Ptr Byte
.data
msg1 byte "Hello World!", 0Ah, 0
.code
main proc
INVOKE printf, ADDR msg1
ret
main endp
end main
Run Code Online (Sandbox Code Playgroud)
嗨,我收到以下错误:
我四处搜索,发现有人说可以通过链接微软运行时库来修复它
任何人都可以教我如何才能完全解决它?
谢谢
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol _printf referenced in function _main testing C:\Users\Kin\Desktop\assembly\testing\testing\Source.obj 1
Error LNK1120 1 unresolved externals testing C:\Users\Kin\Desktop\assembly\testing\Debug\testing.exe 1
Run Code Online (Sandbox Code Playgroud) 我正在写自己的小操作系统。我已经完成启动,进入保护模式,一些文本打印以及与qemu的串行通信。我已经尝试添加中断两天了。我到处都在寻找,包括其他系统资源。不,我下面没有代码,qemu(我不知道为什么)关闭了。我包括geust errorsqemu。
这是我的主文件 kernel.cpp
__asm__ (".pushsection .text.start\r\n" \
"jmp main\r\n" \
".popsection\r\n");
#include <stdbool.h>
#include "utils/debug.h"
#include "drivers/display.h"
#include "drivers/serial.h"
#include "drivers/keyboard.h"
#include "drivers/pic.h"
#include "interrupt/interrupt.h"
void initDrivers(){
serial::init();
pic::init();
interrupt::init();
interrupt::enable();
terminal_initialize();
}
int main() {
initDrivers();
terminal_setcolor(VGA_COLOR_WHITE);
terminal_writestring("Hello!");
debug::println("after println");
bool alive = true;
while(alive) {
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
PIC驱动程序pic.cpp和pic.h
#include "pic.h"
#include <stddef.h>
#include <stdint.h>
#include "IO.h"
#include "../utils/debug.h"
/*
* IMR - Interrupt Mask Register
* IRR - Interrupt Request …Run Code Online (Sandbox Code Playgroud) 我意识到有人提出并关闭了一个非常相似的问题,因为它不够具体,也没有说明结果。 关闭的话题
问题:从 REST 控制器返回的 JSON 为空。经过验证的数据存在并且在 Iterable 中。
预期结果:将返回一个包含对象的 JSON 数组。
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.codeexcursion</groupId>
<organization>
<name>Chris Lynch</name>
</organization>
<version>1.00.000</version>
<artifactId>work-tracking</artifactId>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.10.RELEASE</version>
</parent>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<name>Work Tracking</name>
<inceptionYear>2017</inceptionYear>
<developers>
<developer>
<id />
<name>Chris Lynch</name>
<email>chrislynch42@yahoo.com</email>
<timezone>-4</timezone>
<roles>
<role>Chief cook and bottle washer.</role>
</roles>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>1.5.10.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>1.5.10.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>1.5.10.RELEASE</version> …Run Code Online (Sandbox Code Playgroud)