[eduos] Re: Address Mapping

  • From: Frank Cornelis <Frank.Cornelis@xxxxxxxxx>
  • To: David Hunt <rhunt@xxxxxxxxxx>
  • Date: Fri, 17 May 2002 15:16:35 +0200 (MEST)

Hi,

> I've got EduOS (with slight modifications) up and running and am in the
> process of adding syscalls. The problem I'm having is how to pass an
> address from a task (e.g. the shell) to the kernel. Obviously, since the
> task thinks it starts at 0x0000, any address it passes to the kernel is
> going to be an offset from there. Unfortunately, I don't see any way for
> the kernel to figure out the real address. Plus there is the potential
> problem of data crossing a page boundary, resulting in a string (or
> other data) spanning non-contiguous addresses. In this case, simple
> address translation wouldn't work.

> Any ideas on how to handle this?

The only way of accessing a block of data in the user process' address
space is to use the paging system to locate the exact address of each
user page you want to access. Of course as you mentioned taking page
boundaries into account. This seems as a lot of work, but actually it's
not that though.
Better would be if EduOS had a memory layout as used under linux where
every system call always has the current process directly mapped into
it's address space. Of course this would mean a great deal of refactoring
the EduOS memory subsystem. Easier is to just use linux :)

Frank.

----------------------------------------
The EduOS home page can be found at:
http://studwww.rug.ac.be/~fcorneli/eduos
----------------------------------------

Other related posts: