Giter Club home page Giter Club logo

ucore_os_plus's Introduction

uCore_plus

##Current Progress We are working on ucore plus for amd64 smp porting. You can chekout the "amd64-smp" branch to see the newest progress of ucore plus.

##Quick Try

  1. download or clone ucore plus source code
  2. cd ucore
  3. make ARCH=i386 defconfig
  4. make
  5. make sfsimg
  6. uCore_run -d obj

##Makefile Cross Compile

set the environment variables:

export ARCH = ?

you can use archs: i386, arm, amd64, mips, or32, um, nios2

export CROSS_COMPILE = ?

(see Makefile in ./ucore)

Kconfig

The top level Kconfig is ./ucore/arch/xxx/Kconfig. You can include other Kconfig

(see ./ucore/arch/arm/Kconfig)

All config option is prefixed with UCONFIG_

Makefile

Supported variables: obj-y, dirs-y

(See ./ucore/kern-ucore/Makefile.build and Makefile.subdir)

Add a new ARCH

In arch/xxx, add Makefile.image and include.mk

***include.mk: define ARCH_INCLUDES and ARCH_CFLAGD, etc.

***Makefile.image: how to generate the executable for your platform.

***Kconfig: your top level Kconfig

***Makefile: recursively add Makefile in your arch directory.

More Document

See ucore/doc

ucore_os_plus's People

Contributors

chyh1990 avatar geraint0923 avatar gnocuil avatar haozhun avatar uuyych avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ucore_os_plus's Issues

The test mboxmap fails with a user panic

Description

Something goes wrong according to the log from the serial console and the test panics.

Commit

4b70dae unittest: Specify a longer timeout for mboxmap.

Reproduce Steps

cd ucore
make ARCH=arm BOARD=goldfishv7 menuconfig (disable DDE)
UCORE_TEST=/testbin/mboxmap make sfsimg
UCORE_TEST=/testbin/mboxmap make kernel
./uCore_test -sf src/user-ucore/testspecs/mboxmap.testspec

Current Result

From the serial console:

kernel_execve: pid = 2, name = "/testbin/mboxmap".
fork children ok.
round 0
round 1
round 2
round 3
round 4
round 5
round 6
round 7
round 8
round 9
-- send count 00: 00456363
-- send count 01: 00455159
-- send count 02: 00455780
-- send count 03: 00456256
-- send count 04: 00456218
-- send count 05: 00454937
-- send count 06: 00456147
-- send count 07: 00456070
-- send count 08: 00456278
-- send count 09: 00455569
-- send count 10: 00456033
-- send count 11: 00454976
-- send count 12: 00456162
-- send count 13: 00454877
-- send count 14: 00455519
-- send count 15: 00456236
-- send count 16: 00455657
-- send count 17: 00455868
-- send count 18: 00457001
-- send count 19: 00457228
-- send count 20: 00455260
-- send count 21: 00455853
-- send count 22: 00456313
wait children ok.
-- recv count 00: 00456416
-- recv count 01: 00455185
-- recv count 02: 00455795
-- recv count 03: 00456260
-- recv count 04: 00456125
-- recv count 05: 00454938
-- recv count 06: 00456083
-- recv count 07: 00456023
-- recv count 08: 00456281
-- recv count 09: 00455483
-- recv count 10: 00455946
-- recv count 11: 00454940
-- recv count 12: 00456258
-- recv count 13: 00454957
-- recv count 14: 00455494
-- recv count 15: 00456251
-- recv count 16: 00455684
-- recv count 17: 00455969
-- recv count 18: 00457005
-- recv count 19: 00457278
-- recv count 20: 00455233
-- recv count 21: 00455868
-- recv count 22: 00456288
wrong: 0, 456363, 456416.
wrong: 1, 455159, 455185.
wrong: 2, 455780, 455795.
wrong: 3, 456256, 456260.
wrong: 4, 456218, 456125.
wrong: 5, 454937, 454938.
wrong: 6, 456147, 456083.
wrong: 7, 456070, 456023.
wrong: 8, 456278, 456281.
wrong: 9, 455569, 455483.
wrong: 10, 456033, 455946.
wrong: 11, 454976, 454940.
wrong: 12, 456162, 456258.
wrong: 13, 454877, 454957.
wrong: 14, 455519, 455494.
wrong: 15, 456236, 456251.
wrong: 16, 455657, 455684.
wrong: 17, 455868, 455969.
wrong: 18, 457001, 457005.
wrong: 19, 457228, 457278.
wrong: 20, 455260, 455233.
wrong: 21, 455853, 455868.
wrong: 22, 456313, 456288.
user panic at tests/mboxmap.c:200:
FAIL: T.T

Expected Result

The test passes.

The bionic libc test test_dlopen_null fails

Description

test_dlopen_null fails. Could not lookup symbol inside executable.

Reproduce Steps

cd ~/ucore_plus/ucore
./uCore_test -s bionic -w 15 -t 45 -f src/user-ucore/testspecs/test_dlopen_null.testpec

Current Result

kernel_execve: pid = 4, name = "/bionic-test/test_dlopen_null".
Could not lookup symbol inside executable !!: Symbol not found:
sfs: unmount: 'simple file system' (1701/10587/12288)
vfs: unmount disk0.
all user-mode processes have quit.
kernel panic at proc.c:1970:

Expected Result

kernel_execve: pid = 4, name = "/bionic-test/test_dlopen_null".
sfs: unmount: 'simple file system' (1701/10587/12288)
vfs: unmount disk0.
all user-mode processes have quit.
kernel panic at proc.c:1970:

9 thread related tests hang

Description

The thread related unit tests, including buggy_event, buggy_wait, pipetest2, spipetest2, threadfork, threadgroup1, threadgroup2, threadtest and threadwork, all hang for at least 10 seconds.

Commit

d5272dc unittest: Remove tests containing i386 specific constraints for arm.

Reproduce Steps

cd ucore
make ARCH=arm BOARD=goldfishv7 menuconfig (disable DDE here)
UCORE_TEST=/testbin/threadfork make sfsimg
UCORE_TEST=/testbin/threadfork make kernel
./uCore_test -t 60 -sf src/user-ucore/testspecs/threadfork.testspec

Current Result

The test times out.

Expected Result

Each test involved finishs in 10 seconds and passes.

amd64 failed to boot when RAM > 1024MB

Description

uCore failed to boot on amd64 with RAM > 1024MB

Commit

a90a7fc Merge branch 'amd64-smp' of https://github.com/chyyuu/ucore_plus

Reproduce Steps

cd ucore
make ARCH=amd64 defconfig
make kernel
make sfsimg
qemu-system-x86_64 -m 1025 -hda obj/kernel.img

Current Result

System reboots when executing src/kern-ucore/arch/amd64/mm/pmm.c:346

Expected Result

Available memory ranges should be successfully detected and managed.

The test primer2 doesn't provide enough primers

Description

The test primer2 is designed to give 1000 primers before it quits. But on uCore for arm, only 774 primers are given (not due to timeout).

Commit

d5272dc unittest: Remove tests containing i386 specific constraints for arm.

Reproduce Steps

cd ucore
make ARCH=arm BOARD=goldfishv7 menuconfig (disable DDE)
UCORE_TEST=/testbin/primer2 make sfsimg
UCORE_TEST=/testbin/primer2 make kernel
./uCore_test -sf src/user-ucore/testspecs/primer2.testspec

Current Result

Only 774 primers are given and the test fails.

Expected Result

Calculate 1000 primers and the test passes.

The test spipetest fails with a memory leak

Description

The memory check carried out after all user-mode processes quit reveals some pages may not be properly freed during the test.

Commit

d5272dc unittest: Remove tests containing i386 specific constraints for arm.

Reproduce Steps

cd ucore
make ARCH=arm BOARD=goldfishv7 menuconfig (disable DDE)
UCORE_TEST=/testbin/spipetest make sfsimg
UCORE_TEST=/testbin/spipetest make kernel
./uCore_test -sf src/user-ucore/testspecs/spipetest.testspec

Current Result

From the serial console:

kernel panic at proc.c:1635:
assertion failed: nr_used_pages_store == nr_used_pages()

Expected Result

The test passes.

The bionic libc test ctime fails

Description

The purpose of "test_ctime.c" is to test types defined in bionic ctime header and to test clock() function.

Actually at current commit ALL bionic tests fail. The 4 passes on Autobuild are because of errors in the testspecs.

Commit

c08c9aa

Environment

Ubuntu GNOME 15.04 64 bit
Pentium Dual Core E5200 with 4 gigs of DDR2 SDRAM
ZShell as default shell, latest goldfish

os_lab_2015
  |_ ucore_lib_bioniclibc
  |_ uClibc
  |_ ucore_plus

Reproduction

cd ~/ucore_plus/ucore 
make ARCH=arm BOARD=goldfishv7 defconfig
make sfsimg
make kernel
./uCore_test -s bionic -w 15 -t 45 -f src/user-ucore/testspecs/test_ctime.testspec

Current Result

kernel_execve: pid = 4, name = "/bionic-test/test_ctime".
instruction page fault at (0x07f30000) 0x6ffff000 0x017: Page-Translation R PID=4
trapframe at 0xc7e7ef68
  r00  0x6fffdfec
  r01  0x00000000
  r02  0x0000862c
  r03  0x00008580
  r04  0x00008524
  r05  0x00000000
  r06  0x00000000
  r07  0x00000000
  r08  0x00000000
  r09  0x00000000
  r10  0x00000000
  fp   0x00000000
  ip   0x00010fd0
  usr_lr   0x00010fc0
  sp   0x6fffdfe8
  lr   0x00000000
  spsr 0x00000050 User
  trap 0x00000003 Prefetch abort
  err  0x00000017
Process 4 killed by kernel.
sfs: unmount: 'simple file system' (1967/10321/12288)
vfs: unmount disk0.
all user-mode processes have quit.
kernel panic at proc.c:2018:
    assertion failed: nr_process == 1 + sysconf.lcpu_count
Welcome to the kernel debug monitor!!
Type 'help' for a list of commands.
K>

Expected Result (TO BE ADDED)

There should be a "tst passed. " string in the output.

The bionic libc test test_setjmp fails

Description
The test_setjmp tries to test that integer and float registers are restored properly. However it fails when test float registers.

setjmp returns not zero
register xx's value is changed :
if (xx != FLOAT_VALUE1) {
fprintf(stderr, "setjmp() is broken for floating point registers !\n");
exit(1);
}

Reproduce steps
cd ~/ucore_plus/ucore
make ARCH=arm BOARD=goldfishv7 defconfig
make sfsimg
make kernel
./uCore_test -s bionic -w 15 -t 45 -f src/user-ucore/testspecs/test_setjmp.testspec

Current result
kernel_execve: pid = 4, name = "/bionic-test/test_setjmp".
setjmp() is broken for floating point registers !

Expected Result
the sentence: "setjmp() is broken for floating point registers !" wouldn't appear

The bionic libc test test_executable_destructor fails

Description
The test_executable_destructor tries to test constructor and destructor functions in executables. But it fails with trapframe printed. See "Current result" for details.

Reproduce steps
cd ~/ucore_plus/ucore
make ARCH=arm BOARD=goldfishv7 defconfig
make sfsimg
make kernel
./uCore_test -s bionic -w 15 -t 45 -f src/user-ucore/testspecs/test_executable_destructor.testspec

Current result
kernel_execve: pid = 4, name = "/bionic-test/test_executable_destructor".
trapframe at 0x7e0af68
r00 0x00000004
r01 0x6fffdf78
r02 0x6fffdfcc
r03 0x6fffdf78
r04 0x30809000
r05 0x00000000
r06 0x00000000
r07 0x0000004b
r08 0x00000000
r09 0x00000000
r10 0x00000000
fp 0x6fffdf94
ip 0x3080902c
usr_lr 0x3080084c
sp 0x6fffdf70
lr 0x6fe81178
spsr 0x60000050 User
trap 0x00000002 Software interrupt
err 0x00000000
undefined syscall 0, pid = 4, name = 4.

Expected Result
The test passes with no trapframe printed but the right output information "OK".

sfs_exectest2 triggers a kernel panic in slab

Description

A kernel panic in slab.c is triggered during the unit test sfs_exectest2, preventing the test from running normally.

Commit

7e99100 unittest: Adapt tests on sfs to the current sfsimg.

Reproduce Steps

cd ucore
make ARCH=i386 menuconfig
UCORE_TEST=/testbin/sfs_exectest2 make kernel
UCORE_TEST=/testbin/sfs_exectest2 make sfsimg
make swapimg
./uCore_test -sf src/user-ucore/testspecs/sfs_exectest2.testspec

Current Result

From serial.log

kernel_execve: pid = 3, name = "/testbin/sfs_exectest2".
1-0: /testbin/sfs_exectest2
kernel panic at slab.c:449:
not a slab page c025b468

Expected Result

The test passes.

pipetest panics (assertion failed) in amd64

Description

pipetest panics (assertion failed) in amd64

Commit

deab5d9 Update autotest report headers

Reproduce Steps

cd ucore
make ARCH=amd64 menuconfig
UCORE_TEST=/testbin/pipetest make sfsimg
UCORE_TEST=/testbin/pipetest make kernel
./uCore_test -f src/user-ucore/testspecs/pipetest.testspec

Current Result

Output from the serial console

kernel_execve: pid = 2, name = "/testbin/pipetest".
child write ok
parent read ok
pipetest step1 pass.
[003] pipe0
mode : c
links : 1
blocks : 0
size : 0
[004] pipe1
mode : c
links : 1
blocks : 0
size : 3968
pipetest step2 pass.
pipetest step3:: total 14, len 14, buf Hello world!, msg Hello world!!., buf[total-1] , buf[total-2]
user panic at tests/pipetest.c:85:
assertion failed: total == len && strcmp(buf, msg) == 0

Expected Result

The test passes.

Wrong error code in faultreadkernel

Description

In the unit test faultreadkernel, the error code in the trapframe doesn't meet the constraint in the test spec file.

Commit

7e99100 unittest: Adapt tests on sfs to the current sfsimg.

Reproduce Steps

cd ucore
make ARCH=i386 menuconfig
UCORE_TEST=/testbin/faultreadkernel make kernel
UCORE_TEST=/testbin/faultreadkernel make sfsimg
make swapimg
./uCore_test -sf src/user-ucore/testspecs/faultreadkernel.testspec

Current Result

The unit test fail with

!! error: missing ' err 0x00000005'

According to serial.log, the error code in the trap frame is " err 0x00000004"

Expected Result

The unit test doesn't fail with the line mentioned above.
Either provide a fix for the kernel or update the test spec with reasonable analysis.

The bionic libc test test_gethostbyname fails

Description

The purpose of the "test_gethostbyname.c" is to get the information of the host through the execution of the "gethostbyname" function with the name of the host as a string type parameter.

The test fails upon the first call to gethostbyname. See "Current Result" for details including printed trapframes.

Reproduce steps

cd ~/ucore_plus/ucore 
make ARCH=arm BOARD=goldfishv7 defconfig
make sfsimg
make kernel
./uCore_test -s bionic -w 15 -t 45 -f src/user-ucore/testspecs/test_getaddrinfo.testspec 

Current result

Expected Result

The test passes.

sfs_exectest1 causes a page fault

Description

The unit test sfs_exectest1 triggers a page fault but it is not supposed so.

Commit

7e99100 unittest: Adapt tests on sfs to the current sfsimg.

Reproduce Steps

cd ucore
make ARCH=i386 menuconfig
UCORE_TEST=/testbin/sfs_exectest1 make kernel
UCORE_TEST=/testbin/sfs_exectest1 make sfsimg
make swapimg
./uCore_test -sf src/user-ucore/testspecs/sfs_exectest1.testspec

Current Result

From serial.log

kernel_execve: pid = 3, name = "/testbin/sfs_exectest1".
trapframe at 0xc7ed9d9c
edi 0x00000002
esi 0x04ff0000
ebp 0xc7ed9e10
oesp 0xc7ed9dbc
ebx 0xc7eca00c
edx 0x000005cc
ecx 0x00216f3c
eax 0x04ff05cc
es 0x----0010
ds 0x----0010
trap 0x0000000e Page Fault
err 0x00000000
eip 0xc010377a
cs 0x----0008
flag 0x00000206 PF,IF,IOPL=0
kernel panic at trap.c:177:
handle pgfault failed in kernel mode. Invalid argument

Expected Result

The test passes.

Wrong sem_id in semtest

Description

In the unit test semtest, the sem_id doesn't meet the constraint in the test spec file.

Commit

7e99100 unittest: Adapt tests on sfs to the current sfsimg.

Reproduce Steps

cd ucore
make ARCH=i386 menuconfig
UCORE_TEST=/testbin/semtest make kernel
UCORE_TEST=/testbin/semtest make sfsimg
make swapimg
./uCore_test -sf src/user-ucore/testspecs/semtest.testspec

Current Result

The unit test fail with

!! error: missing 'sem_id = 0x07......'

In serial.log, the sem_id is

sem_id = 0x000000011fe625e0

Expected Result

The unit test doesn't fail with the line mentioned above.
Either provide a fix for the kernel or update the test spec with reasonable analysis.

The bionic libc test lib_static_init fails

Description

The purpose of the "lib_static_init.cpp" is to make the counter of library object useful by create a static variable . if it is used the static variable plus 1

Reproduce steps

cd ~/ucore_plus/ucore
make ARCH=arm BOARD=goldfishv7 defconfig
make sfsimg
make kernel
./uCore_test -s bionic -w 15 -t 45 -f src/user-ucore/testspecslib_static_init.testspec

Current result

Expected Result

The test passes.

The bionic libc test test_seteuid fails

Description

The test_seteuid tries to seteuid to an arbitary user id (9999 in this case). And then set it back to 0.

It fails upon first call to seteuid, with trapframe printed. See "current result" for details.

Reproduce steps

cd ~/ucore_plus/ucore 
make ARCH=arm BOARD=goldfishv7 defconfig
make sfsimg
make kernel
./uCore_test -s bionic -w 15 -t 45 -f src/user-ucore/testspecs/test_seteuid.testspec 

Current result

kernel_execve: pid = 4, name = "/bionic-test/test_seteuid".
<1>todo __wake_up
sizeof(uid_t) = 4 sizeof(gid_t) = 4
start: ruid=0 euid=0
trapframe at 0x7e0af68
r00 0xffffffff
r01 0x0000270f
r02 0xffffffff
r03 0xff0a0000
r04 0x308005dc
r05 0x00000000
r06 0x00000000
r07 0x000000d0
r08 0x00000000
r09 0x00000000
r10 0x00000000
fp 0x6fffdf94
ip 0x6fea10fd
usr_lr 0x6fe88a2f
sp 0x6fffdf70
lr 0x6fe810d0
spsr 0x60000050 user
trap 0x00000002 software interrupt
err 0x00000000
undefined syscall 0, pid = 4, name = 4.

bionic libc test test_clone fails

Description

test_clone.c fails. The father process calls "clone" function and gets pid of its child process. But something goes wrong before father finish "waitpid" function.

Reproduce Steps

cd ~/ucore_plus/ucore
./uCore_test -s bionic -w 15 -t 45 -f src/user-ucore/testspecs/test_clone.testpec

Current Result

From the serial console:

kernel_execve: pid = 4, name = "/bionic-test/test_clone".
child pid 5
trapframe at 0x7b64fb0
r00 0x00000000
r01 0x00000000
r02 0x00000000
r03 0x00000000
r04 0x00000000
r05 0x30800750
r06 0x00000000
r07 0x0000001a
r08 0x00000000
r09 0x00000000
r10 0x00000000
fp 0x3080cfe4
ip 0x3080903c
usr_lr 0x6fe8529c
sp 0x3080cfb0
lr 0x6fe81124
spsr 0xa0000050 User
trap 0x00000002 Software interrupt
err 0x00000000
undefined syscall 0, pid = 5, name = .
file->fd:3
kernel panic at fs.c:64:
assertion failed: file->status == FD_NONE
Welcome to the kernel debug monitor!!

Expected Result

child pid 5
waitpid returned 5
child 5, status 0x137f

Trap frame address mismatch with test specs

Description

From the serial console, we get "trapframe at 0xdfe87fbc", while test specs requires the address of the trap frames should be "0xc.......".
The test cases affected by this issue include badsegment, divzero, faultread, faultreadkernel, testbss and softint.

Commit

b8ad77a unittest: Bring in the complete set of tests from the original uCore.

Reproduce Steps

cd ucore
make ARCH=i386 menuconfig
UCORE_TEST=/testbin/divzero make kernel
UCORE_TEST=/testbin/divzero make sfsimg
make swapimg
./uCore_test -sf src/user-ucore/testspecs/divzero.testspec

Current Result

The unit tests involved fail with "!! error: missing 'trapframe at 0xc.......'"

Expected Result

The unit tests involved should not fail because of this issue, either by update the test specs if it is reasonable or by a fix in uCore itself.

eventtest runs too slow in amd64

Description

eventtest runs too slow in amd64

Commit

deab5d9 Update autotest report headers

Reproduce Steps

cd ucore
make ARCH=amd64 menuconfig
UCORE_TEST=/testbin/eventtest make sfsimg
UCORE_TEST=/testbin/eventtest make kernel
./uCore_test -f src/user-ucore/testspecs/eventtest.testspec

Current Result

$ ./uCore_test -f src/user-ucore/testspecs/eventtest.testspec
./uCore_test: line 138: 12088 Killed ( ulimit -t $timeout; exec ./uCore_run -d $BUILD_DIR -t $$ ) > /dev/null 2>&1
!! error: missing 'test2 pass.'
!! error: missing 'test3 pass.'
!! error: missing 'eventtest pass.'
!! error: missing 'all user-mode processes have quit.'
!! error: missing 'init check memory pass.'

Expected Result

The test passes in the default time limit (currently 10s).

rv32: Question on interactions with SFENCE.VMA

In the current spec, from what I understand so far:

writes to ptes in memory need to be synchronized with sfence.vma
writes to pmp csrs need to be synchronized with sfence.vma
writes to the satp csr do not need to be synchronized with sfence.vma edit: to clarify, here, what I mean is that the very next instruction fetch following a write to satp that enable translation should be translated.

Alexandre Joannou和Andrew Waterman的互动:

对于当前指令集手册中关于SFENCE.VMA的部分可以做如下解读:

对内存中的PTEs进行写操作需用SFENCE.VMA进行同步;
对PMP CSRs进行写操作需用SFENCE.VMA进行同步;
对satp CSR进行写操作无需使用SFENCE.VMA进行同步(即,紧跟在使能转换的写satp操作后的那条指令的取指地址是会被转换的)。
对PMP CSRs进行写操作需显式的同步,而对satp的操作则不需要,暗示着某种微架构支持(可能是一种在大多数实现中的流水线阻塞)
从描述上来看,为什么对PMPs的操作描述相较于satp“没有那么严谨”?

Andrew Waterman 认为这是为了更容易使用缓存标签和TLB等机制来实现对PMPs的缓存,而satp本身则不被缓存。
一种相关的硬件行为描述如下:某些有效的PTEs已被缓存在系统中,此时更新PMP使那些PTEs无法再被访问。尽管如此,这些PTEs依然可以被命中,直到一个SFENCE.VMA指令(rs1=x0,rs2=x0)的执行。

Andrew Waterman 认为Alexandre Joannou描述的这种硬件行为是正确的。

riscv/riscv-isa-manual#204

The bionic libc test test_getaddrinfo fails

Description

The test_getaddrinfo tries to get addrinfo from "www.android.com:9999" ,at first without the hints and then with the hints. .

It fails upon first call to getaddrinfo, with trapframe printed. See "current result" for details.

Reproduce steps

cd ~/ucore_plus/ucore 
make ARCH=arm BOARD=goldfishv7 defconfig
make sfsimg
make kernel
./uCore_test -s bionic -w 15 -t 45 -f src/user-ucore/testspecs/test_getaddrinfo.testspec 

Current result

kernel_execve: pid = 4, name = "/bionic-test/test_getaddrinfo".
trapframe at 0x7e06f68
r00 0x00000001
r01 0x00000001
r02 0x00000000
r03 0x00000004
r04 0x6fed5fdc
r05 0x6fffddac
r06 0x00000000
r07 0x00000119
r08 0x00000000
r09 0x00000000
r10 0x00000000
fp 0x6fffdf94
ip 0x40000000
usr_lr 0x6feb698d
sp 0x6fffdd60
lr 0x6fe81f3c
spsr 0x60000050 User
trap 0x00000002 Software interrupt
err 0x00000000
undefined syscall 0, pid = 4, name = 4.

Expected Result

The test passes.

Threadgroup1 leads to memory leak

Description

In the unit test threadgroup1, the test sometimes (but not always) end with memory leak.

Commit

5d1fdc2 Mark threadgroup1 as a known failure on i386 and amd64

Reproduce Steps

cd ucore
make ARCH=i386 defconfig
UCORE_TEST=/testbin/threadgroup1 make kernel
UCORE_TEST=/testbin/threadgroup1 make sfsimg
./uCore_test -f src/user-ucore/testspecs/threadgroup1.testspec

Current Result

The unit test fail with

!! error: missing 'init check memory pass.'

Expected Result

Init check memory should pass.

rv32: fn setup_page_table(frame: Frame) ?

in arch/riscv32/paging.rs
// Set kernel identity map
p2[0x40].set(Frame::of_addr(PhysAddr::new(0x10000000)), ......);
p2[KERNEL_PML4].set(Frame::of_addr(PhysAddr::new((KERNEL_PML4 as u32) << 22)),......);
p2[KERNEL_PML4 + 1].set(Frame::of_addr(PhysAddr::new((KERNEL_PML4 as u32 + 1) << 22)),......);

What's the meaning of these mappings?

@wangrunji0408

sfs_dirtest# panics when try to enter 'home'

Description

The sfs_dirtest[123] fails and, according to the serial console log, it panics when it want to enter the directory 'home'.

Commit

5d76237 autotest: Adjust test options for running on the test server

Reproduce Steps

cd ucore
make ARCH=i386 menuconfig
UCORE_TEST=/testbin/sfs_dirtest1 make kernel
UCORE_TEST=/testbin/sfs_dirtest1 make sfsimg
make swapimg
./uCore_test -sf src/user-ucore/testspecs/sfs_dirtest1.testspec

Current Result

The unit tests fail and the line

!! error: got unexpected line 'user panic at .*'

is found in the result.

Expected Result

The unit test passes.

The bionic libc test hello_world fails

Description
hello_world.cpp fails. The father process calls "cout" function. But something goes wrong.

Reproduce Steps
cd ~/ucore_plus/ucore
./uCore_test -s bionic -w 15 -t 45 -f src/user-ucore/testspecs/test_hello_world.testpec

Current Result
From the serial console:

kernel_execve: pid = 4, name = "/bionic-test/test_hello_world".
sfs: unmount: 'simple file system' (1701/10587/12288)
vfs: unmount disk0.
all user-mode processes have quit.
kernel panic at proc.c:1970:
assertion failed: nr_process == 1 + pls_read(lcpu_count)
Welcome to the kernel debug monitor!!
Type 'help' for a list of commands.

Expected Result
Hello World

Future Work
The problem maybe caused by lacking of bioniclibc library. But, although I put bioniclibc library to the sfs, somethings goes wrong too. I will solve the bug in the week. Maybe it's caused by the high address '0xffffXXXX' which is pagefault.

spipetest leads to memory leak in arm

Description

spipetest leads to memory leak in arm

Commit

deab5d9 Update autotest report headers

Reproduce Steps

cd ucore
make ARCH=arm BOARD=goldfishv7 menuconfig (disable DDE)
UCORE_TEST=/testbin/spipetest make sfsimg
UCORE_TEST=/testbin/spipetest make kernel
./uCore_test -sf src/user-ucore/testspecs/spipetest.testspec

Current Result

From the serial console:

kernel_execve: pid = 2, name = "/testbin/spipetest".
child write ok
parent read ok
spipetest pass
sfs: unmount: 'simple file system' (7470/4818/12288)
vfs: unmount disk0.
all user-mode processes have quit.
kernel panic at proc.c:2020:
assertion failed: nr_used_pages_store == nr_used_pages()

Expected Result

The test passes without memory leak.

The unit test 'primer' takes too much time

Description

The test 'primer' is soooo slow (10 minutes isn't enough for it to finish the work). As the maximum time allowed for a Qemu test instance to run is 600 seconds (and 10 seconds by default), this test will always time out and make a failure.

Commit

7e99100 unittest: Adapt tests on sfs to the current sfsimg.

Reproduce Steps

cd ucore
make ARCH=i386 menuconfig
UCORE_TEST=/testbin/primer make kernel
UCORE_TEST=/testbin/primer make sfsimg
make swapimg
./uCore_run

Current Result

You can have a sound sleep before the program exits :)

Expected Result

The test takes as much time as primer2 and primer3.

Assertion "nr_used_pages_store == nr_used_pages()" fails

Description

In the checks after all user-mode processes quits, the assertion "nr_used_pages_store == nr_used_pages()" always fails, which means some pages allocated has not been properly freed.

Commit

b8ad77a unittest: Bring in the complete set of tests from the original uCore.

Reproduce Steps

cd ucore
make ARCH=i386 menuconfig
make kernel
make sfsimg
make swapimg
./uCore_run
(Press Ctrl-C in Qemu)

Current Result

From the serial port:
"kernel panic at proc.c:1634:"
" assertion failed: nr_used_pages_store == nr_used_pages()"

Expected Result

From the serial port:
"init check memory pass"
init check memory pass.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.