Difference between flat memory model and protected memory model? VxWorks supports flat memory model, Does Linux also supports flat memory model?
Difference between flat memory model and protected memory model?
6.2k Views Asked by Ritesh At
1
There are 1 best solutions below
Related Questions in LINUX
- How do I recursively find and replace only in files named index.php on Linux webserver?
- passing text with \n as one argument in shell
- kernel module does not print packet info
- How to send ESC/POS commands to thermal printer in Linux
- (x64 Nasm) Writeline function on Linux
- How do I set the Hive user to something different than the Spark user from within a Spark program?
- Default priority of thread with SCHED_FIFO
- Calling a python function with options from shell script
- How to split a directory into parts without compressing or archiving?
- Cross compile simple standard C program on Linux for Mac
- How to offload NAPI poll function to workqueue
- python netifaces - How to get currently used network interface
- Unexpected output from function
- mingw-64 conflicting declarations when cross-compiling
- Different behavior of async with Visual Studio 2013(Windows8.1) and GCC 4.9(Ubuntu14.10)
Related Questions in MEMORY
- DataTable does not release memory
- Impala Resource Estimation for queries with Group by
- Is there any way to get a lru list in Linux kernel?
- C# console application - Unhandled exception while finding the Available and free Ram space.Getting exact answer in windows forms application
- Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in PHP
- C# equivalent of Java Memory mapping methods
- How to figure out the optimal fetch size for the select query
- Creating two arrays with malloc on the same line
- Using parse.com and having allocation memory issue
- error reading variable: cannot access memory at address
- CentOS memory availability
- Correct idiom for freeing repr(C) structs using Drop trait
- Find Ram/Memory manufacturer in Linux?
- Profiling memory usage on App Engine
- Access Violation: 0xC0000005, why is this happening?
Related Questions in MEMORY-MANAGEMENT
- Calling Dealloc method in sprite kit
- Allocating memory for pointers inside structures in functions
- Beginner iOS memory management
- Deleting a dynamically allocated 2D array
- DataTable does not release memory
- how to resize image properly without memory warning
- Application Verifier limits Heap Allocations by default?
- C++ assign const reference to instance variable (memory issues?)
- What memory issues may arise from a single page JavaScript/AJAX application when kept open over a period of months?
- How to increase PHP memory_limit in Debian Jessie?
- Is this correct point to free char*
- Using parse.com and having allocation memory issue
- Qt object ownership when using lambda as slot
- Any ideas why one object is not deallocated in objective-c ARC
- How do I set a buffer in a possibly recursive procedure?
Related Questions in MODEL
- How to create dynamic pages without form_for helper in Rails?
- How to get header and data from Models in Python?
- Sails JS - How to Work With Specific Model Attributes from the Associated Controller
- Django Models - How to relate a single class to several variants
- Custom validation message (in model file) that includes a path not working
- Access database with new pacakage in Laravel 4.2
- Rails 4 Attendance system
- How to pass a specific model field to views' functions or methods?
- same name component and model in cakePhp?
- Laravel 5 Eloquent belongsTo() foreign key won't work
- Custom accessors Eloquent Model
- Laravel 5.0.33 Illuminate\Database\Eloquent\Model not found in line 5
- Django override-able abstract field for inlineformset
- Symfony2 proper use for services
- Subclass of Django Model Not Accessible from Superclass
Related Questions in VXWORKS
- Task Activation VxWorks vs. Posix
- Does free() free the memory immediately
- Changing IP address at runtime
- define string at compiler options
- vxworks message queue "lost" a task blocked on it. What can be a reason?
- Can statfs() read a remote FTP drive?
- tftpGet error from tftpLib in VxWorks
- i get a tftp timeout from vxworks
- manully establish connection to ftp server using sockets
- How can I send [SYN] with bare sockets?
- read from ftp socket in vxworks
- why is this not writing (receiving) the correct number of Bytes?
- How to know the limitations of specific VxWorks version?
- VxWorks CF creatred with dosFsVolFormat cannot be read on Windows
- Error using Boost C++ Libraries with VxWorks
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
In order to give an answer that makes sense, let's review some concepts first.
Most modern processors have a Memory Management Unit (MMU) which is used for a number of purpose.
One purpose is to map between the Virtual Address (the one the CPU "sees") and the Physical Address (where the chips are actually connected). This is called address translation.
Another purpose is to set access attributes for certain virtual memory locations (things like memory is Read-Write, or Read-Only, or not accessible)
With an MMU, you can have what is called "unity mapping" where the processor's virtual address is the same as the physical address (i.e. you don't use address translation). For example, if the processor accesses 0x10000, then it is accessing the physical location 0x10000.
A "flat" memory model typically refers to the fact that any virtual address the CPU accesses is unique. Thus, for a 32-bit CPU, you are limited to a maximum of 4G of address space.
It is most often (though not necessarily) used to refer to a unity mapping between virtual and physical memory.
In contrast, in the workstation world, most Operating Systems (Linux/Windows) use an "overlapped" memory model. For example, any program you launch (a Process) in Windows, will have a start address of 0x10000.
How can windows have 10 processes all running from address 0x10000?
It's because each processes uses the MMU to map the virtual address 0x10000 to different physical addresses. To P1 could have 0x10000 = 0x10000 while P2 has 0x10000 = 0x40000, etc...
In RAM, the programs are at different physical addresses, but the CPU Virtual address space looks the same for each process.
As far as I know, Windows and Standard Linux always use an overlapped model (i.e. they don't have a flat model). It is possible that uLinux or other special kernel could have a flat model.
Now, protection has nothing to do with a flat vs. protected model. I would say that most overlapped model OSes will use protection so that one process does not affect (i.e. write into the memory of) another one.
With VxWorks 6.x and the introduction of Real-Time Processes, even with a flat memory model, individual RTPs are protected from each other (and kernel apps) by using protection.
If you don't use RTPs and run everything in the vxWorks kernel, then there is no protection used.
So, how does protection work (whether in VxWorks RTPs or other OSes Process)? Essentially, the RTP/Process exists inside a "memory bubble" with a certain range of (virtual) addresses that contains code, data, heap, and other assorted memory location.
If the RTP/Process attempts to access a memory location outside it's bubble, the MMU generates an exception and the OS (or signal handler) gets called. The typical result is a segment violation/bus exception.
But how can a process send a packet to an ethernet port if it can't escape it's memory bubble? This varies by processor architectures, but essentially, the user-side (RTP) socket library (for example) makes a "system call" - which is a special instruction which switches the cpu to the kernel space and supervisor mode. At this point, some sort of device driver (that typically reside in the kernel) runs to push the data to some hardware device. Once that's done, the system call returns and we're back in the RTP/process space running the user code.
The OS takes care of all the MMU programming, system call handling, etc... This is invisible to the application.