RE: l4-hackers Digest, Vol 105, Issue 9
Hi all. I have similar problem. Currently applications on linux can't use mmap of framebuffer(/dev/fb0). When apps access memory to get through mmap, it occurs page fault. Without goos, fbdrv of L4 cell, mag, l4fb drv in linux, etc on, Is there ways that it modify <linux lcd device driver> little bit as other linux device drivers In other words, could Apps use allocated memory in linux kernel? As a guide, Because of using dedicated frame buffer only in one cell(linux), it mustn't use things like goos, mag. thanks ------------------------------ Message: 1 Date: Tue, 24 Jan 2012 20:03:36 +0100 From: Adam Lackorzynski <adam@os.inf.tu-dresden.de> To: l4-hackers@os.inf.tu-dresden.de Subject: Re: Fiasco.OC x86 IO port permission bitmap Message-ID: <20120124190336.GE2897@os.inf.tu-dresden.de> Content-Type: text/plain; charset=iso-8859-1 Hi, On Mon Jan 23, 2012 at 15:54:29 -0800, Daniel Waddington wrote:
I want to use the TSS I/O permission bit map to support fine grained control of I/O access for user-level apps (x86 32 bit target). From looking at the kernel code, I believe the bit map is switched out per-process as part of the Context class (Space::_io_space) - correct me if I am wrong. My query is how to set/clear the bits for a given target task from a "root" task with sufficient privileges (e.g., base caps and sigma0 caps). I could extend the kernel scheduler protocol, but I don't want to do this if there is already a clean way in place.
IO-ports are handled similar to page-faults, i.e. they can be mapped to other tasks, and the pager receives io-page-faults when one of its clients accesses an IO-port without having it. For example look for L4_PROTO_IO_PAGE_FAULT and l4_iofpage(). Adam -- Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/ ------------------------------ Message: 2 Date: Tue, 24 Jan 2012 13:12:03 -0800 From: Daniel Waddington <d.waddington@samsung.com> To: Adam Lackorzynski <adam@os.inf.tu-dresden.de> Cc: l4-hackers@os.inf.tu-dresden.de Subject: Re: Fiasco.OC x86 IO port permission bitmap Message-ID: <4F1F1EA3.7060309@samsung.com> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Hi Adam, I see. So it seems that you have to map all of the IO port space before getting IOPL raised to 3 (assuming Kconfig IO_PROT & !IO_PROT_3) and therefore the default mode of operation is a driver will map the whole space if it wants to use IO instructions directly. Is it right that you currently don't use the TSS IO bitmap to allow access to only specific IO ports with CPL > IOPL? Thanks Daniel On 01/24/2012 11:03 AM, Adam Lackorzynski wrote:
Hi,
On Mon Jan 23, 2012 at 15:54:29 -0800, Daniel Waddington wrote:
I want to use the TSS I/O permission bit map to support fine grained control of I/O access for user-level apps (x86 32 bit target). From looking at the kernel code, I believe the bit map is switched out per-process as part of the Context class (Space::_io_space) - correct me if I am wrong. My query is how to set/clear the bits for a given target task from a "root" task with sufficient privileges (e.g., base caps and sigma0 caps). I could extend the kernel scheduler protocol, but I don't want to do this if there is already a clean way in place. IO-ports are handled similar to page-faults, i.e. they can be mapped to other tasks, and the pager receives io-page-faults when one of its clients accesses an IO-port without having it. For example look for L4_PROTO_IO_PAGE_FAULT and l4_iofpage().
Adam
Hi, On Thu Jan 26, 2012 at 11:10:17 +0900, jangwoo wrote:
I have similar problem. Currently applications on linux can't use mmap of framebuffer(/dev/fb0). When apps access memory to get through mmap, it occurs page fault.
Without goos, fbdrv of L4 cell, mag, l4fb drv in linux, etc on, Is there ways that it modify <linux lcd device driver> little bit as other linux device drivers
In other words, could Apps use allocated memory in linux kernel?
As a guide, Because of using dedicated frame buffer only in one cell(linux), it mustn't use things like goos, mag.
I'm not sure I'm getting your question right but you want to have an L4Linux with direct fb access? This is a rather unusual setup but nevertheless possible. In any case you need fbdrv because it's setting up the fb. One common exception is on x86 where the bootloader can also set it up. Regarding input handling L4Linux would probably do it with its own drivers. Adam -- Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/
Is there ways that it modify <linux lcd device driver> little bit as other linux device drivers
In other words, could Apps use allocated memory in linux kernel?
Hi jangwoo. For at91sam9g45 I replaced the function mmap in linux fb driver: static int l4fb_mmap(struct fb_info *info, struct vm_area_struct *vma) { unsigned long size, offset; size = vma->vm_end - vma->vm_start; offset = vma->vm_pgoff << PAGE_SHIFT; if (offset + size > info->fix.smem_len) return -EINVAL; offset += info->screen_base; vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); if (remap_pfn_range(vma, vma->vm_start, offset >> PAGE_SHIFT, size, vma->vm_page_prot)) return -EAGAIN; return 0; } .. static struct fb_ops atmel_lcdfb_ops = { .. .fb_mmap = l4fb_mmap, .. }; Alexander
participants (3)
-
Adam Lackorzynski -
jangwoo -
sasamy