POV-Ray : Newsgroups : povray.off-topic : Memory-mapped I/O : Re: Memory-mapped I/O Server Time
6 Oct 2024 08:23:53 EDT (-0400)
  Re: Memory-mapped I/O  
From: Orchid Win7 v1
Date: 17 Feb 2015 18:25:30
Message: <54e3cdea$1@news.povray.org>
On 17/02/2015 11:15 PM, Lars R. wrote:
>> Similarly, if I want to ask the harddisk to do something, do I need to
>> explicitly construct ATAPI commands, or does the chipset do that for me?
>
> just mmap() your /dev/sd* to your address space and feel free to
> read/write into it.

Yeah, that's not quite it.

When you ask the kernel "hey, mmap() this file for me, will ya?", what's 
actually happening is that when you try to access those memory pages, 
your application gets suspended while the kernel goes and issues the 
necessary disk I/O commands to read a copy of that file into memory. 
Your application then gets resumed, making it *look like* the logical 
file is indeed mapped into the address space.

This isn't the same thing at all. This is clever software making the 
process *look* simple, which isn't at all the same as the process 
actually *being* simple.

Case in point: you can mmap() files residing on an NFS server on another 
continent. Clearly the CPU and chipset know *nothing* about TCP sliding 
windows and go-back-N acknowledgements. That's why you have a huge, 
complex operating system controlling the CPU. ;-)

What I'm asking is, can the hardware itself map the framebuffer (or 
whatever) into the address space, not whether some program can simulate 
this behaviour.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.