build: Remove DragonOS_GCC And make CI use docker image (#954)

* build: 不再需要x86_64-elf-gcc的支持
* ci: 添加ci用的docker镜像
* 切换workflow到构建用的容器上

---------

Signed-off-by: longjin <longjin@DragonOS.org>
This commit is contained in:
LoGin
2024-10-10 00:59:50 +08:00
committed by GitHub
parent 1bd12bc2ff
commit 415e46ea47
37 changed files with 260 additions and 921 deletions

View File

@ -1,10 +0,0 @@
SRC = $(wildcard *.c)
OBJ = $(SRC:.c=.o)
CFLAGS += -I .
.PHONY: all
all: $(OBJ)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@

View File

@ -1,54 +0,0 @@
#include "syscall.h"
#include <arch/arch.h>
#include <common/errno.h>
#include <common/fcntl.h>
#include <common/string.h>
#include <mm/slab.h>
#include <process/process.h>
#if ARCH(I386) || ARCH(X86_64)
// 导出系统调用入口函数定义在entry.S中
extern void syscall_int(void);
/**
* @brief 通过中断进入系统调用
*
* @param syscall_id
* @param arg0
* @param arg1
* @param arg2
* @param arg3
* @param arg4
* @param arg5
* @param arg6
* @param arg7
* @return long
*/
long enter_syscall_int(ul syscall_id, ul arg0, ul arg1, ul arg2, ul arg3,
ul arg4, ul arg5) {
long err_code;
__asm__ __volatile__("movq %2, %%rdi \n\t"
"movq %3, %%rsi \n\t"
"movq %4, %%rdx \n\t"
"movq %5, %%r10 \n\t"
"movq %6, %%r8 \n\t"
"movq %7, %%r9 \n\t"
"int $0x80 \n\t"
: "=a"(err_code)
: "a"(syscall_id), "m"(arg0), "m"(arg1), "m"(arg2),
"m"(arg3), "m"(arg4), "m"(arg5)
: "memory", "r8", "r9", "r10", "rdi", "rsi", "rdx");
return err_code;
}
#else
long enter_syscall_int(ul syscall_id, ul arg0, ul arg1, ul arg2, ul arg3,
ul arg4, ul arg5) {
while (1) {
/* code */
}
}
#endif

View File

@ -1,21 +0,0 @@
#pragma once
#include <common/glib.h>
#include <common/kprint.h>
#include <common/unistd.h>
#include <process/ptrace.h>
/**
* @brief 初始化系统调用模块
*
*/
extern int syscall_init();
/**
* @brief 用户态系统调用入口函数
* 从用户态进入系统调用
* @param syscall_id 系统调用id
* @return long 错误码
*/
long enter_syscall_int(ul syscall_id, ul arg0, ul arg1, ul arg2, ul arg3, ul arg4, ul arg5);

View File

@ -1,102 +0,0 @@
#pragma once
/**
* 请注意由于系统调用模块已经使用Rust重构当修改系统调用号时需要同时修改syscall_num.h和syscall/mod.rs中的系统调用号
* 并且以syscall/mod.rs中的为准
*
* TODO在完成系统的重构后删除syscall_num.h
*
*/
// 定义系统调用号
#define SYS_READ 0
#define SYS_WRITE 1
#define SYS_OPEN 2
#define SYS_CLOSE 3
#define SYS_FSTAT 5
#define SYS_LSEEK 8
#define SYS_MMAP 9
#define SYS_MPROTECT 10
#define SYS_MUNMAP 11
#define SYS_BRK 12
#define SYS_SIGACTION 13
#define SYS_RT_SIGRETURN 15
#define SYS_IOCTL 16
#define SYS_DUP 32
#define SYS_DUP2 33
#define SYS_NANOSLEEP 35
#define SYS_ALARM 37
#define SYS_GETPID 39
#define SYS_SOCKET 41
#define SYS_CONNECT 42
#define SYS_ACCEPT 43
#define SYS_SENDTO 44
#define SYS_RECVFROM 45
#define SYS_RECVMSG 47
#define SYS_SHUTDOWN 48
#define SYS_BIND 49
#define SYS_LISTEN 50
#define SYS_GETSOCKNAME 51
#define SYS_GETPEERNAME 52
#define SYS_SETSOCKOPT 54
#define SYS_GETSOCKOPT 55
#define SYS_CLONE 56
#define SYS_FORK 57
#define SYS_VFORK 58
#define SYS_EXECVE 59
#define SYS_EXIT 60
#define SYS_WAIT4 61
#define SYS_KILL 62
#define SYS_UNAME 63
#define SYS_FCNTL 72
#define SYS_FTRUNCATE 77
#define SYS_GET_DENTS 78
#define SYS_GETCWD 79
#define SYS_CHDIR 80
#define SYS_MKDIR 83
#define SYS_RMDIR 84
#define SYS_LINK 86
#define SYS_GETTIMEOFDAY 96
#define SYS_ARCH_PRCTL 158
#define SYS_MOUNT 165
#define SYS_REBOOT 169
#define SYS_GETPPID 110
#define SYS_GETPGID 121
#define SYS_MKNOD 133
#define SYS_FUTEX 202
#define SYS_SET_TID_ADDR 218
#define SYS_UNLINK_AT 263
#define SYS_LINKAT 265
#define SYS_PIPE 293
#define SYS_WRITEV 20
// 与linux不一致的调用在linux基础上累加
#define SYS_PUT_STRING 100000
#define SYS_SBRK 100001
/// todo: 该系统调用与Linux不一致将来需要删除该系统调用
/// 删的时候记得改C版本的libc
#define SYS_CLOCK 100002
#define SYS_SCHED 100003