tyfkda / xv6

64bit port of xv6
Other
6 stars 0 forks source link

Environment variable #15

Closed tyfkda closed 6 years ago

takeharukato commented 6 years ago

Hi,

I wrote a patch to solve this issue as a trial. Apparently, it seems to work fine. However, you know, system calls in exec(2) family are complex a little so it might needs a thorough review. Anyway, I've sent a PR, would you please give it a try.

I show a simple test log as follows.

$ make qemu
qemu-system-x86_64 -serial mon:stdio -net none -drive file=fs.img,index=1,media=disk,format=raw -drive file=xv6.img,index=0,media=disk,format=raw -smp 2 -m 512
xv6...
acpi: cpu#0 apicid 0
acpi: cpu#1 apicid 1
acpi: ioapic#0 @fec00000 id=0 base=0
cpu1: starting 1
cpu0: starting 0
sb: size 1000 nblocks 942 ninodes 200 nlog 30 logstart 2 inodestart 32 bmap start 57
init: starting sh
$ bin/envtest
user argv:0x3fc0 environ:0x3fd0
envs: environ[0]:  TERM=xv6
(exitcode = 0)
$ bin/envtest
user argv:0x3fc0 environ:0x3fd0
envs: environ[0]:  TERM=xv6
(exitcode = 0)
$ bin/envtest
user argv:0x3fc0 environ:0x3fd0
envs: environ[0]:  TERM=xv6
(exitcode = 0)
$

Thanks, Regards,

takeharukato commented 6 years ago

Hi,

Thank you for your through review. I am sorry to bother you.

Thanks, Regards,

tyfkda commented 6 years ago

No problem :) Thanks a lot.