mirror of
https://gitlab.os-k.eu/os-k-team/os-k.git
synced 2023-08-25 14:03:10 +02:00
Syscall
This commit is contained in:
parent
9abb67a194
commit
6a3646bd28
6
Makefile
6
Makefile
@ -102,7 +102,7 @@ NC='\033[1;37m'
|
|||||||
LibCSources = libc/mem.c libc/ctype.c \
|
LibCSources = libc/mem.c libc/ctype.c \
|
||||||
libc/rand.c libc/sprintf.c \
|
libc/rand.c libc/sprintf.c \
|
||||||
libc/errno.c libc/string.c \
|
libc/errno.c libc/string.c \
|
||||||
libc/strtol.c \
|
libc/strtol.c libc/syscall.c \
|
||||||
libbuf/bopen.c libbuf/bputc.c libbuf/bscroll.c \
|
libbuf/bopen.c libbuf/bputc.c libbuf/bscroll.c \
|
||||||
libbuf/bprint.c libbuf/bgetc.c libbuf/bscan.c \
|
libbuf/bprint.c libbuf/bgetc.c libbuf/bscan.c \
|
||||||
libbuf/bflush.c libbuf/bwrite.c libbuf/bread.c \
|
libbuf/bflush.c libbuf/bwrite.c libbuf/bread.c \
|
||||||
@ -219,6 +219,10 @@ $(KOBJDIR)/libc/mem.o: $(KALEIDDIR)/libc/mem.c | $(KOBJDIR)
|
|||||||
@$(KCC) -fno-strict-aliasing $< -o $@
|
@$(KCC) -fno-strict-aliasing $< -o $@
|
||||||
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||||
|
|
||||||
|
$(KOBJDIR)/libc/syscall.o: $(KALEIDDIR)/libc/syscall.asm | $(KOBJDIR)
|
||||||
|
@mkdir -p $(shell dirname $@)
|
||||||
|
@$(ASM) $(ASMFLAGS) $(KALEIDDIR)/libc/syscall.asm -o $@
|
||||||
|
@echo ${CL2}[$@] ${CL}Compiled.${CL3}
|
||||||
|
|
||||||
## KERNEL SPECIAL RECIPES MAKEFILE ------------------------------------------- #
|
## KERNEL SPECIAL RECIPES MAKEFILE ------------------------------------------- #
|
||||||
|
|
||||||
|
@ -13,10 +13,11 @@ registers
|
|||||||
|
|
||||||
#### Arguments
|
#### Arguments
|
||||||
|
|
||||||
rdi : system call code
|
rax : system call code
|
||||||
rsi : first argument
|
rdi : first argument
|
||||||
rdx : second argument
|
rsi : second argument
|
||||||
r10 : third argument
|
rdx : third argument
|
||||||
|
rcx : fourth argument
|
||||||
|
|
||||||
#### Return value
|
#### Return value
|
||||||
|
|
||||||
|
34
include/sys.h
Normal file
34
include/sys.h
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
//----------------------------------------------------------------------------//
|
||||||
|
// OS on Kaleid //
|
||||||
|
// //
|
||||||
|
// Desc: System calls //
|
||||||
|
// //
|
||||||
|
// //
|
||||||
|
// Copyright © 2018-2021 The OS/K Team //
|
||||||
|
// //
|
||||||
|
// This file is part of OS/K. //
|
||||||
|
// //
|
||||||
|
// OS/K is free software: you can redistribute it and/or modify //
|
||||||
|
// it under the terms of the GNU General Public License as published by //
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or //
|
||||||
|
// any later version. //
|
||||||
|
// //
|
||||||
|
// OS/K is distributed in the hope that it will be useful, //
|
||||||
|
// but WITHOUT ANY WARRANTY//without even the implied warranty of //
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
||||||
|
// GNU General Public License for more details. //
|
||||||
|
// //
|
||||||
|
// You should have received a copy of the GNU General Public License //
|
||||||
|
// along with OS/K. If not, see <https://www.gnu.org/licenses/>. //
|
||||||
|
//----------------------------------------------------------------------------//
|
||||||
|
|
||||||
|
#ifndef _SYS_H
|
||||||
|
#define _SYS_H
|
||||||
|
|
||||||
|
#ifndef _LIBC_H
|
||||||
|
#include <libc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
error_t SysStartKernelShell(void);
|
||||||
|
|
||||||
|
#endif
|
31
kaleid/libc/syscall.asm
Normal file
31
kaleid/libc/syscall.asm
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
;=----------------------------------------------------------------------------=;
|
||||||
|
; OS on Kaleid ;
|
||||||
|
; ;
|
||||||
|
; Desc: System calls ;
|
||||||
|
; ;
|
||||||
|
; ;
|
||||||
|
; Copyright © 2018-2021 The OS/K Team ;
|
||||||
|
; ;
|
||||||
|
; This file is part of OS/K. ;
|
||||||
|
; ;
|
||||||
|
; OS/K is free software: you can redistribute it and/or modify ;
|
||||||
|
; it under the terms of the GNU General Public License as published by ;
|
||||||
|
; the Free Software Foundation, either version 3 of the License, or ;
|
||||||
|
; (at your option) any later version. ;
|
||||||
|
; ;
|
||||||
|
; OS/K is distributed in the hope that it will be useful, ;
|
||||||
|
; but WITHOUT ANY WARRANTY; without even the implied warranty of ;
|
||||||
|
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;
|
||||||
|
; GNU General Public License for more details. ;
|
||||||
|
; ;
|
||||||
|
; You should have received a copy of the GNU General Public License ;
|
||||||
|
; along with OS/K. If not, see <https://www.gnu.org/licenses/>. ;
|
||||||
|
;=----------------------------------------------------------------------------=;
|
||||||
|
|
||||||
|
global SysStartKernelShell
|
||||||
|
|
||||||
|
SysStartKernelShell:
|
||||||
|
mov eax, 4
|
||||||
|
int $0x80
|
||||||
|
ret
|
||||||
|
|
Loading…
Reference in New Issue
Block a user