LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-22-2003, 08:00 AM   #1
captainstorm
Member
 
Registered: Jun 2003
Location: Oricola, Italy
Distribution: RH 9, so far
Posts: 261

Rep: Reputation: 31
8254, interrupt


Hello all,

I have a puzzle here. I have found a couple of different options on the internet on how to program the 8254, and the following are 3 versions to retrive the original init vector.

1. 2. 3.
mov al, 1ch mov al,08h mov al,00h
mov ah, 35h mov ah,35h mov ah,35h
int 21h int 21h int 21h

The first puzzle is: al=00h is the IRQ for timer/counter but al=08h is for real time clock. The example utilize 08h, but why not 00h?

Also I am not sure whether to use al=1ch or al=08h

Thank you all
 
Old 09-22-2003, 08:02 AM   #2
captainstorm
Member
 
Registered: Jun 2003
Location: Oricola, Italy
Distribution: RH 9, so far
Posts: 261

Original Poster
Rep: Reputation: 31
Oh, I lost the format, the 1~3 versions should be:
1.
mov al, 1ch
mov ah, 35h
int 21h

2.
mov al,08h
mov ah,35h
int 21h

3.
mov al,00h
mov ah,35h
int 21h
 
Old 09-22-2003, 08:20 AM   #3
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
int 0x21 is installed by dos and wont exist unless your running it, for extensive docs on 8254 try here
 
Old 09-23-2003, 08:05 AM   #4
captainstorm
Member
 
Registered: Jun 2003
Location: Oricola, Italy
Distribution: RH 9, so far
Posts: 261

Original Poster
Rep: Reputation: 31
Thank you kev, but sorry I do not understand this "won't exist unless your running it". Do you mean int 0x21 is not available under linux? Sorry for this.
 
Old 09-23-2003, 10:08 AM   #5
captainstorm
Member
 
Registered: Jun 2003
Location: Oricola, Italy
Distribution: RH 9, so far
Posts: 261

Original Poster
Rep: Reputation: 31
Quote:
Originally posted by kev82
int 0x21 is installed by dos and wont exist unless your running it[/url]
I think the "it" is referring to "DOS". I see.

But are there any ways to treat the interrupt under linux (gas)? I am curious since it makes less sense to me that assembler could not deal with the interrupt. I have searched on the internet but it appears only int 21h 35 and int 21h 25 could do the job.

Any suggestions?
(Thanks again Kev)
 
Old 09-23-2003, 12:35 PM   #6
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
you understood correctly, int 0x21 is a service provided by dos and thus only works under dos. however im pretty sure you can program the 8254 from somewhere in /proc i think mplayer uses it to sync video. there is a LinuxGazette article about driving a speaker using the 8254. and the link i gave above has full technical documents on the chip.
 
Old 09-24-2003, 08:39 AM   #7
captainstorm
Member
 
Registered: Jun 2003
Location: Oricola, Italy
Distribution: RH 9, so far
Posts: 261

Original Poster
Rep: Reputation: 31
Yeah thanks kev

While actually the application is not a time-critical one. To set time out or something like that. I originally plan to take a chance to learn how to deal with interrupt under linux, but in this typical program, "singal handling" by gcc might also be a good choice.

I have read the datasheet and like a datasheet, its explanation is clear and straight forward. But the things I will look for is the interrupt, which is different from simply "org0004".
A short break
 
  


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
MP-BIOS bug: 8254 timer not connected to IO-APIC Hook99 Linux - Newbie 3 12-28-2021 02:45 AM
<0>Kernel panic: Aiee, killing interrupt handler! In interrupt handler - not syncing mrb Linux - Newbie 2 01-09-2005 09:47 AM
about interrupt dummyagain Programming 0 10-26-2003 02:09 AM
interrupt dummyagain Programming 5 10-20-2003 09:09 PM
interrupt??? raven Linux - Hardware 1 06-10-2002 06:57 AM

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

All times are GMT -5. The time now is 10:26 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