Project

General

Profile

Actions

Feature #682

closed

Add extra Linux sys-calls to runtime

Added by Runar Tenfjord 7 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Category:
Linux
Target version:
-
% Done:

100%


Description

In order to complete the OS support code for a library I am working on
I added some extra sys-calls to the linux runtime.

runtime/amd64linuxrun.asm:

    system_call    sys_mkdir, 83, 2
    system_call    sys_rmdir, 84, 1
    system_call    sys_getcwd, 79, 2
    system_call    sys_chdir, 80, 1
    system_call    sys_stat, 4, 2
    system_call     sys_ftruncate, 77, 2
    system_call    sys_getdents64, 217, 3

and the corresponding changes to libraries/oberon/api.linux.mod:

PROCEDURE ^ MkDir* ["sys_mkdir"] (pathname: SYSTEM.ADDRESS; mode: INTEGER): INTEGER;
PROCEDURE ^ RmDir* ["sys_rmdir"] (pathname: SYSTEM.ADDRESS): INTEGER;
PROCEDURE ^ GetCWD* ["sys_getcwd"] (buffer: SYSTEM.ADDRESS; size: LENGTH): SYSTEM.ADDRESS;
PROCEDURE ^ ChDir* ["sys_chdir"] (pathname: SYSTEM.ADDRESS): INTEGER;
PROCEDURE ^ Stat* ["sys_stat"] (pathname: SYSTEM.ADDRESS; statbuf: SYSTEM.ADDRESS): INTEGER;
PROCEDURE ^ FTruncate* ["sys_ftruncate"] (fd: INTEGER; length: LENGTH): INTEGER;
PROCEDURE ^ GetDents* ["sys_getdents64"] (fd: INTEGER; buf: SYSTEM.ADDRESS; count: LENGTH): INTEGER;

This adds support for basic directory handling, directory/file listing and some missing file operations.
Please consider adding this to the next version. I have not access to 32bit linux, but expect the
corresponding sys-calls to be available.

Unfortunate some of the information structures are implementation defined and I therefore did not
add any definition of these ( GetDents & Stat ).

Actions #1

Updated by Florian Negele 7 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

The requested system calls will be part of the next release, thank you.

Actions

Also available in: Atom PDF