From ed090c5b4bd844cea243b9ef155832f4d5c0d8f4 Mon Sep 17 00:00:00 2001 From: YanLien Date: Sun, 28 Jan 2024 22:40:23 +0800 Subject: [PATCH] zlm_1_6 --- README.md | 1 + modules/axprocess/src/api.rs | 8 ++- testcases/testsuits-x86_64-linux-musl/wait | Bin 0 -> 36624 bytes testcases/testsuits-x86_64-linux-musl/wait.c | 55 ++++++++++++++++++ testcases/testsuits-x86_64-linux-musl/wait1 | Bin 0 -> 36624 bytes testcases/testsuits-x86_64-linux-musl/wait1.c | 55 ++++++++++++++++++ ulib/axstarry/syscall_entry/src/test.rs | 2 + ulib/axstarry/syscall_task/src/imp/task.rs | 1 + ulib/axstarry/syscall_utils/src/ctypes.rs | 6 +- 9 files changed, 122 insertions(+), 6 deletions(-) create mode 100755 testcases/testsuits-x86_64-linux-musl/wait create mode 100644 testcases/testsuits-x86_64-linux-musl/wait.c create mode 100755 testcases/testsuits-x86_64-linux-musl/wait1 create mode 100644 testcases/testsuits-x86_64-linux-musl/wait1.c diff --git a/README.md b/README.md index e5812999b2..60e3c75841 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ make run ```shell # 构建镜像 ./build_img.sh sdcard + # 运行 Unikernel 架构内核 make run diff --git a/modules/axprocess/src/api.rs b/modules/axprocess/src/api.rs index 542b81d1cd..0edf5dc35f 100644 --- a/modules/axprocess/src/api.rs +++ b/modules/axprocess/src/api.rs @@ -57,7 +57,7 @@ pub fn exit_current_task(exit_code: i32) -> ! { let curr_id = current_task.id().as_u64(); - info!("exit task id {} with code {}", curr_id, exit_code); + info!("exit task id {} with code _{}_", curr_id, exit_code); clear_wait( if current_task.is_leader() { process.pid() @@ -228,11 +228,12 @@ pub unsafe fn wait_pid(pid: isize, exit_code_ptr: *mut i32) -> Result ResultN1TIS8q698V;GzUBO5madE=u5{1TIS8q698V;GzWnk0el3+<5{13GvF) zMa7bQG+TMdnx&q{8kW6mZR$?DAVdhbC07t6+h>yUsT7^{(&t+flKfGxN@S?E6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8tE~cr z8B7(~T0z6n76ZZz!kdAqfhxj`HPxVi*NmD9WHb^`P+}& zwX{dyM>T7osXCmeeEBs1y$ZRZ_4W0$nb+^Tc>tAVICuc~t)%+;J;(IhHI#2^e>$(v zm(7FsA&a#7KOdu|`rD#scsdIy@vqm{?@d0#H%R6t;p^*a9ZdK7#^O)sQ$Odd@oE^! z`1-e=Qa9<>k9vLmytV$HtiJ+viGRJmeqWP*QAp2PEg5)Q269@a6v@!~`n^u|8`{^& zlqc06IR9OxVPxxwJk|THrvbo+wy)n4wXD)Au>W#1uSHECE9x}Z+|0AFg!HI-^ZWcZ(T05 nkErvG?7-8{H+G7!pE2~&+tp#TPd;3I=?M+vF&&Yo$@Tvq!Rj8- literal 0 HcmV?d00001 diff --git a/testcases/testsuits-x86_64-linux-musl/wait.c b/testcases/testsuits-x86_64-linux-musl/wait.c new file mode 100644 index 0000000000..0bb56ce090 --- /dev/null +++ b/testcases/testsuits-x86_64-linux-musl/wait.c @@ -0,0 +1,55 @@ +#include +#include +#include +#include +#include +#include + +// // #define WEXITSTATUS(s) (((s)&0xff00) >> 8) +// // #define WIFEXITED(s) (!WTERMSIG(s)) +// #define WIFEXITED(s) ((s)&0x7f) + +int main(void) +{ + pid_t pid, wpid; + int status; + int i = 0; + pid = fork(); + // printf(" %d \n", pid); + if (pid == -1) { + // fork失败 + perror("fork failed"); + exit(EXIT_FAILURE); + } else if (pid == 0) { //子进程 + printf("Child --- My Parent is %d\n", getppid()); + sleep(5); + // 子进程的任务完成,现在退出 + printf("Child Process is exiting\n"); + exit(9); // 退出子进程 + } else if(pid > 0) { //父进程 + wpid = wait(&status); //等待回收子进程 + + printf("Status %d\n", status); + + if(wpid == -1) { + perror("wait error:"); + exit(1); + } + + while(i < 3) { + printf("Parent Pid = %d, SonPid = %d\n", getpid(), pid); + sleep(1); + i++; + } + + printf("Parent: Status %d WIFEXITED(status) == %d\n", status, WIFEXITED(status)); + + //WEXITSTATUS get the return code + printf("Parent: Status %d The return code WEXITSTATUS(status) == %d\n", status, WEXITSTATUS(status)); + } else { + perror("for error"); + exit(1); + } + + return 0; +} \ No newline at end of file diff --git a/testcases/testsuits-x86_64-linux-musl/wait1 b/testcases/testsuits-x86_64-linux-musl/wait1 new file mode 100755 index 0000000000000000000000000000000000000000..0d8f9dca126428e0d6bb5cddc1262a24f9cdfe8b GIT binary patch literal 36624 zcmeIbeSB2awKskynIsbkoB=_if{Z%aqzGnIN=86uU9n?w?e%(ZZ|&>TUfWu4doiM7UXTP-3RpFWDB#-}1~Gz$fWZ8|YoC3RFebIn z^SgiiKEDsA&Dr~`z4qE`uf6tKYrhO`aC;Y}84QB{qzN|)^i^nfFp%~Zgk6uaPYx>- zG6jb)K`=91<4_TD4*sR3k8#p^iYn|Oa0cc0x4_%e)9kqnP0&*vkLt1ZinVf~*r8>3 z`tCUGQ%{H2%S2JFPb;sjaj=Y@_M~a>r?RzFuebE0a2eJ6XCJ*gx1k>KIa+&k0elB(sd60aq-eq z#U+w_Bv-lLnxme@8kW6m?dlG@AVdkcC0`IE+ozK9i4>dt!e=ihCHccXmB>(SDLO}r ztu(o9+dbXwnYTCusk?(#^-_1YeS$-XUk;Mxv&88wtX(NK|JhQIi)H*LCH8^vWU0HI zilo-|aCY*5IK7F!x_AowW`;leUP|)MN=l#9ar7psV<25JY?F4M4Nn?Iz?3{tE>3q1 z)h7;{=DSf>h|E|a$@33=7g^Ij4`^O0i6Rf^qjwH$vMI?z_< zz`&Yq?NT(SQ%bf=t=l7CNHJrlq-6Xt0L*Bv)VdG)CVzEheYO-WHc86zcP*0KZccn4 zMO&;-5mhDQ4u;!ewGeeEWfoxb8O&uZMqZ(OYd?lK`d4c%Vc2p`QuIYD%_Mam(E$%l#Dm>sZHP>xPueb$ z>@C)fNF!q<`9*6lazglfn;~ogT}AIrTcCGnXty`!vYL)R-R-iPK}~3b?g(C`8{fIK z+a)PG#EjPVM#C4I*=KD2d-DWgOInj4IQw0_nU?TaN!cZ4pwGaOl3fr~dgQ}x85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ZF<|{?b}tajucW zqJ>;lGz$;VAjkT&222-;zt%?*;(|(P9%HK6Phgb#*~L_FNcbs;gIIJkkY8^Eo17`l z+EAl`u&zm^Fzy7wOsUof-(OSP$jqiL9CkVVYmE(dCxwY&CSVwc=gxB!keswJBHIT* zie1*sF5q0szG_^@4DsP2y++ZHW{|%IfN2|9eD3G~($$qNGUIc|X5fRYNyt}I&1?j| ztKbG}{JO^Dn+>e5yq=V<6t;xV1u#W->B%CZK+_<7>}jSkTgt~9mpK^<)Z4en<8?D_ zSw~YxcVo!XrB%9pj%;bzhY`jEIA`usR}sh1n6p^IM-H27a1gh)OJUnImEhBgHO212 zmR3P5b==$eLhEor*T>r$76_5#h>>&MJ?rM6R%z0u*~D_85Sv(}YlCvpyhj7E8KS|` z>|lyDB@sX$fTW3zk0y(wG_57^u!+RIK0XH}jyQ#CatDhnaA4?$>>LUQBN`ObxPbxu zW&t#rDr;7rEE)!d4VFIlG@+Ae=YDW#5Vf9x27G>5P1TUS3DAvpz|V19_}2QSw~R?R zIAL^S=OcyGxX|Yw_3~bX&qL&g$%st>=#v&vpf35mP-7Kx!$y*#9@2lrd58sZ8TwoW z;6tywaW;iQ759>K0*EMsKK6qYUwLIILQRSZP@p3-`^%BJ8X}HmYRLUAkRf~umhT({oHIXVKsav)G`_3f3@b&kC&5Rsq5+ zriyH>py6nX0bv&5&BD|`6=Bxe8c@J%R&6CR8VM+-XOwulrh9$k@u%~tpL5pwG>lYy z{aa6|oAm2Py}o|l+VD@-Ux~WJzg}OzuSvfsq-UL$48ARcIW1F$WO#l3UZ?sE?dxPJ zQtA($|E|_Ba&<(W>iyQ!AmGE>*YAm1R%;d5f4Q00rNlBUPuT|i5iPy{`hC*EHB>4H zy9O0o`?hGw;G6bOsQrRLh?ddo&q#q2E +#include +#include +#include +#include +#include + +// // #define WEXITSTATUS(s) (((s)&0xff00) >> 8) +// // #define WIFEXITED(s) (!WTERMSIG(s)) +// #define WIFEXITED(s) ((s)&0x7f) + +int main(void) +{ + pid_t pid, wpid; + int status; + int i = 0; + pid = fork(); + // printf(" %d \n", pid); + if (pid == -1) { + // fork失败 + perror("fork failed"); + exit(EXIT_FAILURE); + } else if (pid == 0) { //子进程 + printf("Child --- My Parent is %d\n", getppid()); + sleep(5); + // 子进程的任务完成,现在退出 + printf("Child Process is exiting\n"); + exit(0); // 退出子进程 + } else if(pid > 0) { //父进程 + wpid = wait(&status); //等待回收子进程 + + printf("Status %d\n", status); + + if(wpid == -1) { + perror("wait error:"); + exit(1); + } + + while(i < 3) { + printf("Parent Pid = %d, SonPid = %d\n", getpid(), pid); + sleep(1); + i++; + } + + printf("Parent: Status %d WIFEXITED(status) == %d\n", status, WIFEXITED(status)); + + //WEXITSTATUS get the return code + printf("Parent: Status %d The return code WEXITSTATUS(status) == %d\n", status, WEXITSTATUS(status)); + } else { + perror("for error"); + exit(1); + } + + return 0; +} \ No newline at end of file diff --git a/ulib/axstarry/syscall_entry/src/test.rs b/ulib/axstarry/syscall_entry/src/test.rs index ef500c25c0..c1b8c8491a 100644 --- a/ulib/axstarry/syscall_entry/src/test.rs +++ b/ulib/axstarry/syscall_entry/src/test.rs @@ -312,6 +312,8 @@ pub const OSTRAIN_TESTCASES: &[&str] = &[ #[allow(dead_code)] pub const SDCARD_TESTCASES: &[&str] = &[ "busybox sh" + // "./wait", + //"./wait1" //"busybox sh ./test_all.sh", // "./riscv64-linux-musl-native/bin/riscv64-linux-musl-gcc ./hello.c -static", // "./a.out", diff --git a/ulib/axstarry/syscall_task/src/imp/task.rs b/ulib/axstarry/syscall_task/src/imp/task.rs index 0331e5bacb..a5e796f378 100644 --- a/ulib/axstarry/syscall_task/src/imp/task.rs +++ b/ulib/axstarry/syscall_task/src/imp/task.rs @@ -183,6 +183,7 @@ pub fn syscall_clone( /// 等待子进程完成任务,若子进程没有完成,则自身yield /// 当前仅支持WNOHANG选项,即若未完成时则不予等待,直接返回0 +/// WIFEXITED(s) WEXITSTATUS(s) pub fn syscall_wait4(pid: isize, exit_code_ptr: *mut i32, option: WaitFlags) -> SyscallResult { loop { let answer = unsafe { wait_pid(pid, exit_code_ptr) }; diff --git a/ulib/axstarry/syscall_utils/src/ctypes.rs b/ulib/axstarry/syscall_utils/src/ctypes.rs index e29ad7ed3f..5500d0862f 100644 --- a/ulib/axstarry/syscall_utils/src/ctypes.rs +++ b/ulib/axstarry/syscall_utils/src/ctypes.rs @@ -172,9 +172,9 @@ impl UtsName { /// 默认的 UtsName,并没有统一标准 pub fn default() -> Self { Self { - sysname: Self::from_str("YoimiyaOS"), - nodename: Self::from_str("YoimiyaOS - machine[0]"), - release: Self::from_str("114"), + sysname: Self::from_str("Starry"), + nodename: Self::from_str("Starry - machine[0]"), + release: Self::from_str("100"), version: Self::from_str("1.0"), machine: Self::from_str("RISC-V 64 on SIFIVE FU740"), domainname: Self::from_str("https://github.com/Azure-stars/arceos"),