我使用 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 …我知道如何检查默认平台,但我需要检查我的应用程序是否在 X11 或 Wayland 上运行。我试试这个:
QString platform = qgetenv("QT_QPA_PLATFORM");
但它返回一个空字符串。
在 Weston 上,当我运行应用程序时,我将 QT_QPA_PLATFORM 设置为 Wayland:
./myApp -platform wayland
但我的 QString 平台仍然是空的,默认平台名称也没有改变。