LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-17-2002, 10:05 AM   #1
wwnn1
Member
 
Registered: Apr 2002
Location: PRC
Posts: 32

Rep: Reputation: 15
Unhappy BIOS Interrupt


In dos,we can call BIOS Interrupt by using some function like this:
/***********************
int86(21H,0AH); or
int(....);
***********************/

How can I call BIOS Interrupt function in linux or gcc?
 
Old 05-17-2002, 03:47 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
If it's BIOS interrupt, it's the same way. But you need assembler compiler (should be in your distro). It's different with system interrupts, of course.
 
Old 05-17-2002, 09:54 PM   #3
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
__asm__ anyone?
 
Old 05-17-2002, 11:42 PM   #4
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
The kernel source has a ton of asm code you could use as an example. I think that cc will compile it for you. It just needs a .S extension.

Code:
find /usr/src/linux -name '*.S' -type f -exec frep "BIOS" {} /dev/null \;
 
Old 05-18-2002, 02:30 AM   #5
wwnn1
Member
 
Registered: Apr 2002
Location: PRC
Posts: 32

Original Poster
Rep: Reputation: 15
I am sorry that I did not tell you clearly.
I mean that how can I call BIOS interrupt in C language?

of course,the assembler compiler will do that.
but, I want to accomplish the function In C.
 
Old 05-18-2002, 06:46 AM   #6
llama_meme
Member
 
Registered: Nov 2001
Location: London, England
Distribution: Gentoo, FreeBSD
Posts: 590

Rep: Reputation: 30
isn't it a bad idea to make a BIOS call from linux? (seeing as the kernel ignores the BIOS completely)
 
Old 05-21-2002, 04:08 AM   #7
sourceman
Member
 
Registered: Feb 2002
Posts: 48

Rep: Reputation: 15
But listen now...

In your first example...
int86(21H,0AH);
This is not a BIOS call. Int 21h is DOS.
You won't get any DOS interrupts in Linux.

Also...

Linux is protected mode. You cannot call interrupts in protected mode. You have to use the protected modde interface.

The linux kernel provides Int 0x80, where most common calls can be found like fork, exec, open close, read etc.
You can get a list of linux system calls from...
www.lxhp.in-berlin.de/lhpsysc0.html
 
Old 05-21-2002, 06:59 AM   #8
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Go to http://www.linuxassembly.org there is lots of documentation and tutorials there on how to run assembly code from c programs.
 
Old 05-23-2002, 06:00 AM   #9
wwnn1
Member
 
Registered: Apr 2002
Location: PRC
Posts: 32

Original Poster
Rep: Reputation: 15
Thanks all !

*^_^*
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Free Interrupt Line In Bios manz Linux - Hardware 2 03-10-2005 02:50 AM
<0>Kernel panic: Aiee, killing interrupt handler! In interrupt handler - not syncing mrb Linux - Newbie 2 01-09-2005 09:47 AM
Easy Bios? (floppy that boots and runs new bios) tearinox Linux - Hardware 5 10-12-2004 05:13 PM
need Bios driver to exec custom on board bios code wmain Linux - Software 0 09-03-2004 08:32 AM
old BIOS (1992) won't detect my cdrom drive; BIOS says: neither IDE prots enabled carbono Linux - Hardware 5 05-18-2004 11:07 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration