multitasking in console mode
multitasking in console mode
I haven't yet got multitasking working but I'm wondering how exactly am I going to do multitasking in console mode cause there is no windows or anything like that so really how will i switch or see the other
-
- Member
- Posts: 144
- Joined: Tue Oct 26, 2004 11:00 pm
- Location: Australia
Re: multitasking in console mode
Look at the way UNIX shells work...they where doing multitasking way back in the '70s dude!
bash is my favorite shell
bash is my favorite shell
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
--- Albert Einstein
Re: multitasking in console mode
OMG like didn't they barely have batch systems thenback in the '70s dude!
Re: multitasking in console mode
Also look at Dos TSR thats basic multi-tasking.
-
- Member
- Posts: 144
- Joined: Tue Oct 26, 2004 11:00 pm
- Location: Australia
Re: multitasking in console mode
No batch processing was early '60s.hckr83 wrote:OMG like didn't they barely have batch systems then
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
--- Albert Einstein
Virtual consoles are how Unix environments handle interacting with mulitple programs on a single machine. My computer has 6 including the 7th's X console. Since you've asked this question, I've assumed you've never use a *nix environment, so I'll explain it to you. Virtual console fake the existance of terminals connected to your computer. If you press ALT+F2 you are taken to the second console, ALT+F3 takes you to the third, and so on. It's basically emulating multiple computers connected to a single machine. Now you don't have to implement it the way *nix does it (where the virtual consoles are terminal emulators and operate with the OS via a fake serial interface), but you get the general idea.
And while TSR's were kind of like multi-tasking, there are not really what the starter of the thread wanted. He, if I understand correctly, wanted to know how to interact with multiple programs at once from a text environment.
And while TSR's were kind of like multi-tasking, there are not really what the starter of the thread wanted. He, if I understand correctly, wanted to know how to interact with multiple programs at once from a text environment.
-
- Member
- Posts: 132
- Joined: Wed Nov 03, 2004 12:00 am
- Location: Austria
- Contact:
- AndrewAPrice
- Member
- Posts: 2309
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
A simple way of implementing multiple console screens is to have multiple screen buffers. Switching consoles (such as pressing ALT+F1, ALT+F2, ALT+F3) switches to active screenbuffer (buffer 1, buffer 2, buffer 3 respectivly). Then change your text library to write to the active buffer. If you have an input buffer, have a seperate one for each console also. It is actually quite simple to implement.
When it starts to become more complex is when you want to add multitasking (i.e. running a program on console 1 while running a different program on console 2).. For these, I suggest that you take a look into multitasking. Cooperative multi-tasking (where by pressing ALT+F2 will switch to Program 2 and halt Program 1) will be much easier to implement. Preemptive multi-tasking (where by pressing ALT+F2 will switch the screen buffer to Program 2 without halting Program 1) is more complex to implement in the short term, but has advantages in the long run. To implement preemptive multi-tasking, take a look into using the timer interrupt to switch between consoles, and only drawing the active console's buffer on the screen.
When it starts to become more complex is when you want to add multitasking (i.e. running a program on console 1 while running a different program on console 2).. For these, I suggest that you take a look into multitasking. Cooperative multi-tasking (where by pressing ALT+F2 will switch to Program 2 and halt Program 1) will be much easier to implement. Preemptive multi-tasking (where by pressing ALT+F2 will switch the screen buffer to Program 2 without halting Program 1) is more complex to implement in the short term, but has advantages in the long run. To implement preemptive multi-tasking, take a look into using the timer interrupt to switch between consoles, and only drawing the active console's buffer on the screen.