Re: Preemptive linux




Rafael Almeida wrote:

Hello,

I've been reading a book about operating systems (operating systems
concepts, seventh edition) and the author says "A preemptive kernel
allows a process to be preempted while it is running in kernel mode.
(...) Prior to Linux 2.6, the Linux kernel was nonpreemptive as well.
However, with the release of the 2.6 kernel, Linux changed to the
preemptive model."

I've written a system call like this:

int sys_foo(void)
{
while (1);
return 0;
}

When I called it, however, the system hang and I was not able to do
anything besides restarting it. Wouldn't that mean that the kernel is
actually nonpreemptive, as if it were preemptive I would be able to get
back to the shell and kill the process?

I've called my syscall using that _syscall0 macro on sys/syscall.h. I
would post the whole thing here but I don't have access to the code
right now, but I think what I've said is enough to everyone to
understand what I've done.

I used linux 2.6.17-gentoo-r7 for the experiment.

Is your kernel premptible. have you enabled premption while menuconfig.


PS: Thank you to everyone who answered my post asking for suggestions
for changing stuff in the kernel.

[]'s
Rafael

.



Relevant Pages

  • Re: Nobody should ever need to patch the kernel!!
    ... | other operating systems for the last 20 years or so. ... just look around for the most famous linux kernel patches... ... Of course, the filesystem could always use FUSE, making it even easier. ...
    (comp.os.linux.development.system)
  • Re: What is Forth best at?
    ... No - Linus studied in Helsinki, and Tanenbaum lectures on the Vrije ... experiments in protected mode, which led to Linux. ... kernel from scratch -- be it in Forth or otherwise. ... which runs on popular operating systems is one thing - writing an ...
    (comp.lang.forth)
  • Re: starting with 2.7
    ... > get into the kernel for stability reasons ever. ... their Linux from a distributor, ... there are two classes of distributors, ... operating systems in the world. ...
    (Linux-Kernel)
  • Re: C library integral part of OS/kernel???
    ... > very low kernel or just outside kernel level? ... but these days I see a lot of Operating systems that are ... > library functions, it's similar to calling the OS specific APIs (same ...
    (comp.lang.c)
  • Re: Fedora 9 git source kernel ??
    ... subject of computers, operating systems, and programs personally ... Linux Kernel Primer, A Top-Down Approach for x86 and Power PC ... "Computer Organization and Architecture, ... I have worked my way through K&R "The C Programming Language" plus parts ...
    (Fedora)