-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
10,381 additions
and
397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: CI Workflow | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Build | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install packages | ||
uses: awalsh128/cache-apt-pkgs-action@latest | ||
with: | ||
packages: xorriso mtools nasm | ||
version: 1.0 | ||
|
||
- name: Setup BuildTools | ||
uses: xmake-io/github-action-setup-xmake@v1 | ||
with: | ||
xmake-version: latest | ||
actions-cache-folder: '.xmake-cache' | ||
|
||
- name: Build Kernel | ||
run: xmake build -y | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: CoolPotOS | ||
path: build/CoolPotOS.iso | ||
compression-level: 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
timeout: 3 | ||
|
||
/CoolPotOS-i386 | ||
protocol: multiboot1 | ||
kernel_path: boot():/sys/cpkrnl.elf | ||
cmdline: desktop |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#include "dlinker.h" | ||
#include "elf_util.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,33 @@ | ||
#include "thread.h" | ||
#include "krlibc.h" | ||
#include "user_malloc.h" | ||
|
||
int get_pcb_threads(pcb_t *pcb){ | ||
static void add_thread(pcb_t *pcb,cp_thread_t thread){ //添加线程至调度链 | ||
if(pcb == NULL || thread == NULL) return; | ||
cp_thread_t tailt = pcb->thread_head; | ||
while (tailt->next != pcb->thread_head) { | ||
if(tailt->next == NULL) break; | ||
tailt = tailt->next; | ||
} | ||
tailt->next = thread; | ||
} | ||
|
||
void create_user_thread(pcb_t *pcb,void* func){ | ||
cp_thread_t thread = kmalloc(STACK_SIZE); | ||
thread->next = NULL; | ||
thread->father_pcb = pcb; | ||
thread->tid = pcb->now_tid++; | ||
thread->kernel_stack = thread; | ||
thread->user_stack = pcb->user_stack; | ||
|
||
uint32_t *stack_top = (uint32_t * )((uint32_t) thread->kernel_stack + STACK_SIZE); | ||
*(--stack_top) = (uint32_t) func; | ||
*(--stack_top) = (uint32_t) process_exit; | ||
*(--stack_top) = (uint32_t) switch_to_user_mode; | ||
thread->context.esp = (uint32_t) thread + STACK_SIZE - sizeof(uint32_t) * 3; | ||
thread->context.eflags = 0x200; | ||
|
||
if(pcb->thread_head == NULL){ | ||
pcb->thread_head = thread; | ||
}else add_thread(pcb,thread); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
#include "vfs.h" | ||
#include "list.h" | ||
|
||
|
||
vfs_node_t rootdir = NULL; | ||
|
||
static void empty_func() {} | ||
|
Oops, something went wrong.