Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to index page
Thread view  Board view

Homepage E-mail

FRANCE [Jura],
07.10.2016, 14:01
(edited by cpcdos, 07.10.2016, 14:30)

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

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 my for my English level, I'm a French student



Czech republic,
07.10.2016, 22:44

@ cpcdos

pascal sources

Maybe some pascal sources could help you.
Try here:


Back to index page
Thread view  Board view
15277 Postings in 1373 Threads, 253 registered users, 12 users online (0 registered, 12 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum