Go to the FreeLists Home Page Home Signup Help Login
 



[openbeosstorage] || [Date Prev] [02-2002 Date Index] [Date Next] || [Thread Prev] [02-2002 Thread Index] [Thread Next]

[openbeosstorage] Re: System calls

  • From: "Tyler Dauwalder" <tyler@xxxxxxxxxxxxx>
  • To: <OpenBeOSStorage@xxxxxxxxxxxxx>
  • Date: Sat, 2 Feb 2002 18:08:17 -0800
This is perhaps the long way of answering, but here's my
current view on how the whole file system works (some or
most or maybe all of this you already know, I realize):

At the bottom, you have your disk with the raw data. On top of
that, you have the filesystem add-ons (i.e. BFS, iso, FAT32, etc)
that implement the kernel's vfs interface (the stuff we're 
documenting at the moment). The vfs layer in the kernel 
manages the various filesystems, and provides an outside 
interface. 

If you're in the kernel, you can call the vfs functions directly. 
In the NewOS kernel, they're the sys_XXX() functions 
found in vfs.h, i.e. sys_mount, sys_open, sys_ioctl, etc. If you're 
in userland, you have to use the syscall interface (I'd never 
programmed x86 assembly before, so I wasn't sure if that
worked the same as it did in MIPS, which is why I had asked
earlier if you knew how we'd have to call the kernel).  To do 
that (for x86), we'll have to push all our arguments on the stack, 
put the # of the system call we're wanting to make in register 
EAX, and trigger a software interrupt with the "int" instruction 
(I think it's interrupt 99 for NewOS x86). That call traps into the 
kernel, which reads in our arguments and does whatever we 
told it to do. Ideally, we'll write C functions similar to the vfs calls 
over POSIX, and then when the kernel is ready, replace those 
with x86 assembly routines that make system calls. 

The syscall interface for the filesystem is going to have to 
be extremely similar to the BeOS vfs layer that we're documenting. 
That's why I still think it's a good idea, even though it's not 
technically the interface we'll be using. The kernel guys 
know we're going to need a way to write attributes and what
not if we're going to support the native BFS file system (which
we are) so I'm sure those calls will be added in good time 
(it may not be until they fork with the NewOS code, though).

So, long story short, I think what we're doing should be fine,
and I'm fairly certain the stuff we need in the kernel will get
added in due time.  :-)

-Tyler

>     I've just been looking throught the NewOS kernel code again & I came 
> across this file (syscalls.c), which contains a list of the system calls 
> supported by NewOS - and they're different from the ones in the Dominic 
> Giampolo book.  Should we be using these instead?
> 
> Mind you, it doesn't seem to cover all the apis we require (no attribute 
> api for example).  Is it worth asking the kernel team whether they will 
> e added?
> 
>                 Keith
> 
[snip]







[ Home | Signup | Help | Login | Archives | Lists ]

All trademarks and copyrights within the FreeLists archives are owned by their respective owners.
Everything else ©2007 Avenir Technologies, LLC.