Note that there are some explanatory texts on larger screens.

plurals
  1. POdifference between Preemption and context switch
    text
    copied!<p>A little intro,</p> <p>I am currently writing a small (read tiny) RTOS kernel, well it's supposed to be monolithic with most stuff in the kernel. However I can't find much information on a few things listed below, It would be a lot helpful and besides this, it isn't actually some kind of university project but something I'm doing at my own will.</p> <p><strong>A better alternative to answering all the questions would be if you could refer to me a freely available RTOS (or even a free book) for arm preferably</strong> which implement userspace and are preemptible (but not complex like linux). Linux has some of the worst documentation I've seen till now (I did try figuring things out from linux code but there are just a tons of defines scattered through a million files and function hooks with wierd names and stuff getting renamed every version also getting moved sometimes...)</p> <ol> <li><p>What is the difference between "preemption" and "context switch" ?</p></li> <li><p>What are the key differences between a preemptive and nonpreemptive kernel ? What all work is required from a programmer to make the kernel preemptive ?</p></li> <li><p>How to create and work with user mode ?</p> <p>ARM docs say that in user mode, any instruction switching to a privileged mode will be treated as undefined instruction. </p></li> <li><p>If so, the only way for a userspace program to use kernel code is syscalls ? </p></li> <li><p>How does a kernel respond or interact with userspace then ? </p></li> <li><p>Does that mean the only kernel thread after booting (in a simple system) would be the idle thread ?</p></li> <li><p>If the Page where kernel code and data resides is unmapped when switching to a user process, then on a syscall or interrupt, how does the kernel code execute without being mapped in the virtual address space ?</p></li> <li><p>Does a 'preemptible kernel' only mean that the kernel was designed in a way that it would be safe to have context switch during execution of kernel code ? or does it require more work to be done if any ?</p></li> </ol> <p>Oh and if such multiple questions are not allowed here, sorry, couldn't find anything about that.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload