Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Making a task switcher ?from scratch?. Some (Developers)

posted by cpcdos(R) Homepage E-mail, FRANCE [Lyon], 07.10.2016, 14:01
(edited by cpcdos on 07.10.2016, 14:30)

Hi all!

I've already posted this subject in FreeDos-Devel

Since more days, I develop "from scratch" my "task switcher" on FreeDos in asm/c++ for preemption. Caution, it's not for switching between DOS executables, but switching in internal current .exe (fonctions stack pointer)

* I succeeded to create stack memory in array, for each tasks added.
* I was not able to "switch" with two stack in asm inline (in Task_Switch() function) .. CRASH

If someone can take his time resolve my problem ? What i forgot ? :-(

This is my complet code with Batch file for compile with GCC/G++ (DJGPP for DOS)

Others informations:
I must to use GCC / G++ / DJGPP for DOS, I started to write my task switching (for internal function) and I've some difficulties :/

In my ZIP, I have a good beginning, I can create tasks with his stack memory and stask pointer location and a task pool array.

I've my IRQ0 (vector 0x09) execute my timer_handler() i use also 0x09 for switch manually with keyboard for debug

I've toto() and tata() functions, he blocks to toto() with while(1); it's normal.
My Task switcher must to interrupt this current loop in toto() task, saving his registers, switching this current stack pointer with the new stack pointer tata(), pop his registers and continue..

If someone can take his time for resolve my problem :-(


FAVIER Sébastien

ps: Excuse me for my English level, I'm a French student


Complete thread:

Back to the forum
Board view  Mix view
15296 Postings in 1378 Threads, 254 registered users, 8 users online (0 registered, 8 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum