小编Mag*_*man的帖子

INT 16h/AH=0h 不等待引导加载程序中的按键

我使用 GNU 汇编器和 AT&T 语法编写了我的第一个引导加载程序。它应该打印hello world到屏幕上,然后通知用户按任意键将导致重新启动。只有按下某个键后才会启动重新启动。我的引导加载程序代码不等待按键,并在打印信息后自动重新启动。为什么此代码不等待击键,我该如何修复它?

我的引导扇区代码:

#generate 16-bit code
.code16

#hint the assembler that here is the executable code located
.text
.globl _start;
#boot code entry
_start:
  jmp _boot                           #jump to boot code
  welcome: .asciz "Hello, World\n\r"  #here we define the string
  AnyKey: .asciz "Press any key to reboot...\n\r"
 .macro mWriteString str              #macro which calls a function to print a string
      leaw  \str, %si
      call .writeStringIn
 .endm

 #function to print the string
 .writeStringIn:
      lodsb
      orb  %al, %al …
Run Code Online (Sandbox Code Playgroud)

assembly gnu-assembler bootloader att x86-16

5
推荐指数
1
解决办法
1354
查看次数

Qt 5.7 如何在运行时检查变量 QT_QPA_PLATFORM 的值?

我知道如何检查默认平台,但我需要检查我的应用程序是否在 X11 或 Wayland 上运行。我试试这个:

QString platform = qgetenv("QT_QPA_PLATFORM");
Run Code Online (Sandbox Code Playgroud)

但它返回一个空字符串。

在 Weston 上,当我运行应用程序时,我将 QT_QPA_PLATFORM 设置为 Wayland:

./myApp -platform wayland
Run Code Online (Sandbox Code Playgroud)

但我的 QString 平台仍然是空的,默认平台名称也没有改变。

c++ qt qt5 wayland qt5.7

4
推荐指数
1
解决办法
1444
查看次数

标签 统计

assembly ×1

att ×1

bootloader ×1

c++ ×1

gnu-assembler ×1

qt ×1

qt5 ×1

qt5.7 ×1

wayland ×1

x86-16 ×1