ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 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.
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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.