为什么此int $ 0x10 BIOS INT在Linux上不起作用? [英] Why is this int $0x10 BIOS INT not working on Linux?

查看:49
本文介绍了为什么此int $ 0x10 BIOS INT在Linux上不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定我是否做错了什么.我正在使用具有Intel芯片的Linux机器上以AT& T语法学习汇编语言.我了解到INT 10H用于出于各种视频目的调用BIOS子例程.

I am not sure if I am doing something drastically wrong. I am learning assembly language in AT&T syntax on a linux machine with intel chip. I learned that INT 10H is used to invoke BIOS subroutines for various video purposes.

我写了这个简单的汇编代码来清除屏幕.

I wrote this simple assembly code to clear the screen.

.section .data

data_items:

.section .text

.global _start
_start:

mov $6, %ah        #  to select the scroll function
mov $0, %al        #  the entire page
mov $7, %bh        #  for normal attribute
mov $0, %ch        #  row value of the start point
mov $0, %cl        #  column value of the starting point
mov $24, %dh       #  row value of ending point
mov $79, %dl       #  column value of the ending point
int $0x10          #  invoke the BIOS INT 10H interrupt 

movl $1, %eax      #  exiting the program
int $0x80

我将它组装在gnome终端中(使用intel芯片上的fedora 19).组装和链接不是问题.但无法运行,并且出现细分错误.为什么会失败以及如何更正代码?

I assembled it in a gnome terminal (using fedora 19 on intel chip). assembling and linking was no issue. but it failed to run and segmentation fault appears. Why it failed and how to correct the code?

推荐答案

Linux和所有现代系统都在受保护的模式下运行,并且当系统处于此模式时无法调用BIOS中断.您可以使用 DOSBox 在Linux中模拟DOS.

Linux and all modern systems run in protected mode and BIOS interrupts can't be called when the system in this mode. You can use DOSBox to emulate DOS in Linux.

这篇关于为什么此int $ 0x10 BIOS INT在Linux上不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆