New tutorial released
New tutorial released
After much kicking from certain people who shall remain nameless, this morning I finally got around to writing the multitasking tutorial. It's part of the series at http://www.jamesmolloy.co.uk. Proofreaders would be most appreciated - I think some people here are waiting to see it anyway so I would appreciate it if people could point out mistakes here!
Cheers!
JamesM
http://www.jamesmolloy.co.uk/tutorial_h ... sking.html
Cheers!
JamesM
http://www.jamesmolloy.co.uk/tutorial_h ... sking.html
Hi,
As always, it looks brilliant and very complete (all other multitasking tutorials I've seen are basically along the lines of "push all regs, switch esp, pop all regs"). I won't be following it as when I already have the design in mind for Caracal and have already implemented multitasking in several test kernels, but I wish this tutorial had been around when I was starting out!
Quick scan proof read reveals no errors other than a minor formatting error at the end (last screenshot seems to overshoot your text frame by a half). I'll have a more detailed look sometime.
Cheers,
Adam
As always, it looks brilliant and very complete (all other multitasking tutorials I've seen are basically along the lines of "push all regs, switch esp, pop all regs"). I won't be following it as when I already have the design in mind for Caracal and have already implemented multitasking in several test kernels, but I wish this tutorial had been around when I was starting out!
Quick scan proof read reveals no errors other than a minor formatting error at the end (last screenshot seems to overshoot your text frame by a half). I'll have a more detailed look sometime.
Cheers,
Adam
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Awesome!
However....
1) The link that points to the source code (download here) points to nothing...you get a 404 error.
2) The code still triple faults in Qemu after a bunch of tasks are started....
-JL
However....
1) The link that points to the source code (download here) points to nothing...you get a 404 error.
2) The code still triple faults in Qemu after a bunch of tasks are started....
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
-
- Member
- Posts: 391
- Joined: Wed Jul 25, 2007 8:45 am
- Libera.chat IRC: aejsmith
- Location: London, UK
- Contact:
Looks cool, but the code to copy a physical frame looks... unsafe. It depends on the kernel being mapped in the same place in both the physical and virtual address spaces. Although not a problem for your tutorial, it will be problematic if someone wants to use that code in, say, a kernel running in the higher half.
yay! another tutorial.
when I get back to my house I will check it out deffinately.
Pe@cE
when I get back to my house I will check it out deffinately.
Pe@cE
Website: https://joscor.com
Hi guys, thanks for taking the time to go through it!
As I say, the idea is to give an idea of how all the pieces fit together, not to do your work for you!
I'll fix the 404 now. Thanks for the comments and please keep 'em coming!
James
Yep, this will always happen as long as synchronisation primitives aren't implemented. It would be overkill to stick them in that tutorial (have you seen the length of it already?!) so just don't stress test it yet.piranha wrote:Awesome!
2) The code still triple faults in Qemu after a bunch of tasks are started....
-JL
Alex, it's perfectly safe. As you say, it's tailored towards an identity mapped kernel (which is what we have in the tutorials). For a higher-half kernel, you *could* use the same technique, just with relative jumps.AlexExtreme wrote:Looks cool, but the code to copy a physical frame looks... unsafe. It depends on the kernel being mapped in the same place in both the physical and virtual address spaces. Although not a problem for your tutorial, it will be problematic if someone wants to use that code in, say, a kernel running in the higher half.
Hi. You're quite right. It is very slow. It involves a complete TLB refresh and also disables interrupts at one point, and don't even get me started on multiprocessing! but it's simple, and that's the aim of these tutorials. It's not to construct a foolproof, fantastic OS, it's to create one that does the job and is simple enough to be understood *fully*. Corner cases like this really do need consideration, but can be glossed over for the greater good in tutorials like this, IMHO.jgraef wrote:I think disabling paging to access physical memory is very slow.
As I say, the idea is to give an idea of how all the pieces fit together, not to do your work for you!
I'll fix the 404 now. Thanks for the comments and please keep 'em coming!
James
-
- Posts: 6
- Joined: Sun Feb 10, 2008 3:11 am
Quote from article:bucket_brigade wrote:Theres one thing i dont undestand about it. You don't seem to save the general purpose registers anywhere... Is that not necessery? Or are they saved implicitly somewhere?
"
This relies on several things:
1. All the general purpose registers are already saved. This happens in the IRQ handler, so is automatic."
-
- Posts: 6
- Joined: Sun Feb 10, 2008 3:11 am