Every operating system needs a method of managing the available memory resources on the computer system that it exists on. Some operating systems, such as Linux, do this through functions internal to the kernel. In fact, all operating systems have some kind of function internal to the kernel, and this is becoming a more popular approach. Older DOS systems, however, provided minimal support for memory management but also placed a hook for an external program, such as EMM386 in DOS 6, to take over the management of memory and provide for greater memory capacities.
The Winux Operating System provides a sort of hybrid memory system. In the same way that the Winux Kernel is a hybrid between a monolithic and microkernel, it is also a hybrid in its memory system. The Winux Memory System acts like the EMM386 program, as another process in the system that handles the memory allocations. However, as far as user applications can tell, the memory allocation takes place within the Winux Kernel since the Winux Memory System is not in Userland, but only in kernel land.
Requirements Home Table of ContentsLike any other memory manager, the primary responsibilities of the Winux Memory System is to allocate memory. However, it is just as important to protect programs from each other as it is to tell a program what memory belongs to it. Thereby, while the Winux Memory System will allow one application to map memory from a device or other application into its available memory (and only at the permission of the program or device driver software), the Winux Memory System will enforce a strict memory boundary policy. That is, a program will not be allowed to read, write, or execute beyond the memory allocated to it.
Requirements Home Table of ContentsThere are many different layouts of memory among operating system implementations. For instance, Microsoft Windows breaks memory into two chunks - User Memory and Kernel Memory - that is about split evenly. Linux, on the other hand, makes the same distinction but does not make the kernel use half the memory, instead using as little as it can to let as much memory as it can for user applications.
The Winux Memory System will employ the same memory layout method as the Linux Kernel. That is, it will not say that the kernel has to exist in certain memory locations, and that user applications must exist in other memory locations. Rather, it will simply enforce the memory boundaries on all applications no matter where they are located in memory. Thus a kernel page and a user-space application page may exist next to each other.
Requirements Home Table of ContentsThere are several methods that are available for the memory scheme. The first choice is between Segmented Memory, Paged Memory, and a combination of the two. When the two are not combined, there is also the choice of a flat memory model. The Winux Memory System will use a Segmented and Paging memory scheme. That is, it will page memory to provide virtual memory and extend the amount of RAM to what the user desires (again, like Linux it will use a dedicated partition or a file mounted as a device for the page swapping). Additionally, the system will enforce memory boundaries by using segmented memory within the paging model.
Programs will then have to have executable, read/write, read, and write pages. Additionally, the heap and stack will both be allocated their own page sets. This will allow programs to have the maximum memory available to them and protect them even from themselves. For instance, one common error is stack overflow. By giving the stack its own page sets, a stack overflow will simply add another page to the set, and it will not be able to overwrite the heap. Programs are not only protected against other programs, but also against themselves. A program will therefore only crash due to memory when there is no memory left. That is not to say that a program will not be able to overwrite parts of itself - data or code - but the possibility to overwrite code is far less, and it is primarily the corruption of the data segments/pages that will cause memory errors. These problems are not preventable but are issues with the code itself. (Code segments must also be requested to have write status. If it is not requested, then the program will not be able to overwrite code that it will execute.)
Requirements Home Table of Contents