Thread: Virtual memory in user space (Operting Systems)

  1. #16
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Quote Originally Posted by Elysia View Post
    Wouldn't a similar approach for a disk driver be possible?
    I don't think so.

    Quote Originally Posted by wiki Kernel
    In most cases, the boot loader starts executing the kernel in supervisor mode.[8]
    Quote Originally Posted by wiki "Supervisor mode"
    In computer terms supervisor mode is a hardware-mediated flag which can be changed by code running in system-level software. System-level tasks or threads will have this flag set while they are running, whereas user-space applications will not. This flag determines whether it would be possible to execute machine code operations such as modifying registers for various descriptor tables, or performing operations such as disabling interrupts. The idea of having two different modes to operate in comes from “with more control comes more responsibility” — a program in supervisor mode is trusted never to fail, since a failure may cause the whole computer system to crash.

    Supervisor mode is “An execution mode on some processors which enables execution of all instructions, including privileged instructions. It may also give access to a different address space, to memory management hardware and to other peripherals. This is the mode in which the operating system usually runs.”
    Like I said before, a hard disk doesn't have to have an OS on it, but if it does it ought to run its driver in kernel space, otherwise the very device that contains the OS is not part of the kernel and that makes no sense. Learning how your computer boots may help you answer some of your own questions.
    Last edited by whiteflags; 05-04-2011 at 04:31 PM.

  2. #17
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Angola
    Posts
    8,445
    Quote Originally Posted by Elysia View Post
    Don't misunderstand my question here.
    Virtual memory is a critical part of the operating system that should not be removed.
    However, the question is really: is it possible to put the code managing the virtual memory for all processes (and possible the OS, too) in user space?
    Technically, yes. It all depends on the OS features you want and the device the OS is designed for. For modern computers it's insane, given today's kernels reach and devices architectures. But for some embed devices, for ROM-based devices, for appliances... whatever.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #18
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I guess I'll postpone the question until I've gotten further. I'll do a case study of Linux, Windows and Symbian later, so I might just check back after that.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #19
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  5. #20
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Angola
    Posts
    8,445
    I've come up on this thread without reading much into it, but now that I've read some of Elysia's posts I think I know what she's on to. I think, an operating system that can actually fully isolate and protect process address spaces without the costs of hardware task switches. Potentially you can have more speed, security and reliability, instead of less, with all memory requirements, communications with other process and whatnot actually able to be better enforceable at runtime.

    But if I read what Elysia is talking about right, this isn't exactly about running everything in user space. There's simply no concept of memory domains. Everything runs in kernel space. I think i did hear of these things before (and actually on these forums a long time ago). I did some searching on Google and came up with Microsoft's Singularity project.
    Last edited by Mario F.; 05-05-2011 at 06:52 PM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  6. #21
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    No, I have a more modern book, "Modern Operating Systems" which I'm reading in preparation for the course I'll attend at the end of the year.

    Quote Originally Posted by Mario F. View Post
    I've come up on this thread without reading much into it, but now that I've read some of Elysia's posts I think I know what she's on to. I think, an operating system that can actually fully isolate and protect process address spaces without the costs of hardware task switches. Potentially you can have more speed, security and reliability, instead of less, with all memory requirements, communications with other process and whatnot actually able to be better enforceable at runtime.

    But if I read what Elysia is talking about right, this isn't exactly about running everything in user space. There's simply no concept of memory domains. Everything runs in kernel space. I think i did hear of these things before (and actually on these forums a long time ago). I did some searching on Google and came up with Microsoft's Singularity project.
    Actually, that's not what I was on to, but this sounds for more interesting. Thanks.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #22
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    Elysia, what you're talking about reminds me of what Mach was trying to do. Basically, it was (is) a microkernel, with everything possible moved into its own process (task), separate from the microkernel. One of these things was the pager, and so it was called an external pager. It would communicate with the other processes (tasks) that implement other things by means of message-based IPC over what they called ports (not IP ports). The problem they ran into was that since a switch was needed to pass data everywhere, it really slowed things down. Whether this is relevant to having an external pager or not, I'm not sure. AFAIK, modern operating systems might have them. If this sounds like what you're asking about, I'd suggest reading about Mach. BTW, Mac OS X de-microkerneled Mach and uses it (with other code) to make its XNU kernel.

    Something being in userspace doesn't mean it's controlled by users. It just means that it has its own limited space to play in, like user programs do.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. NUMA Virtual Adress Space / Physical Adress Space
    By NUMA Orly in forum Windows Programming
    Replies: 0
    Last Post: 03-14-2011, 03:19 AM
  2. Max Out Virtual Memory Space
    By newbe in forum Windows Programming
    Replies: 0
    Last Post: 05-06-2010, 10:46 AM
  3. user space control for device driver
    By itisravi in forum Linux Programming
    Replies: 5
    Last Post: 03-02-2010, 02:17 PM
  4. Replies: 2
    Last Post: 09-28-2006, 01:06 PM
  5. space problem with user input
    By codebrawler in forum C++ Programming
    Replies: 5
    Last Post: 01-08-2006, 02:01 PM