GithubHelp home page GithubHelp logo

sergev / litebsd Goto Github PK

View Code? Open in Web Editor NEW
301.0 41.0 36.0 48.37 MB

Variant of 4.4BSD Unix for microcontrollers

License: Other

Makefile 1.25% Prolog 0.03% C 89.79% GAP 0.05% C++ 0.40% Shell 0.76% Max 0.01% Brainfuck 0.01% Awk 0.10% Perl 4.89% Logos 0.01% Scilab 0.01% R 0.01% Clojure 0.01% Assembly 2.54% OpenEdge ABL 0.02% TeX 0.08% Ruby 0.01% PostScript 0.08% Component Pascal 0.01%

litebsd's Introduction

LiteBSD

LiteBSD is a variant of 4.4BSD operating system adapted for microcontrollers. Currently, only the Microchip PIC32MZ family is supported as a target. It is equipped with MMU with paging support, and 512kbytes of on-chip RAM. These resources are enough to build a compact networked embedded system.

For more information, see LiteBSD Wiki pages.

Precompiled binaries for several PIC32MZ boards are available from Autobuild Download page.

If you are looking for the LiteBSD ports tree please see this repository.

litebsd's People

Contributors

calmsacibis995 avatar ibara avatar majenkotech avatar sergev 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

litebsd's Issues

Problems compiling on Ubuntu 20.04

I'm trying to compile the LiteBSD kernel on Ubuntu 20.04 x86_64 architecture and I'm having trouble completing it.
I am following the explanations provided by the Wiki at this link: https://github.com/sergev/LiteBSD/wiki/Build. I installed all the necessary tools and set the variables as required. Furthermore, it removes the -Werror flag from the compiler as reported in this issue link: #71

My console output is this:
:/mnt/d/Development/LiteBSD$ bmake kernel
bmake -Csys/compile all
bmake -C../../usr.sbin/config
gcc -c config.c
config.y: In function ‘checksystemspec’:
config.y:1003:21: warning: implicit declaration of function ‘minor’ [-Wimplicit-function-declaration]
1003 | if (minor(dev) & 07) {
| ^~~~~
config.y:1010:20: warning: implicit declaration of function ‘makedev’ [-Wimplicit-function-declaration]
1010 | makedev(major(dev), (minor(dev) &~ 07) | ('b' - 'a' + 1));
| ^~~~~~~
config.y:1010:28: warning: implicit declaration of function ‘major’ [-Wimplicit-function-declaration]
1010 | makedev(major(dev), (minor(dev) &~ 07) | ('b' - 'a' + 1));
| ^~~~~
gcc -c main.c
flex lang.l
mv lex.yy.c lang.c
gcc -c lang.c
gcc -c mkioconf.c
gcc -c mkmakefile.c
gcc -c mkglue.c
gcc -c mkheaders.c
gcc -c mkswapconf.c
mkswapconf.c: In function ‘do_swap’:
mkswapconf.c:90:17: warning: implicit declaration of function ‘major’ [-Wimplicit-function-declaration]
90 | major(fl->f_rootdev), minor(fl->f_rootdev));
| ^~~~~
mkswapconf.c:90:39: warning: implicit declaration of function ‘minor’ [-Wimplicit-function-declaration]
90 | major(fl->f_rootdev), minor(fl->f_rootdev));
| ^~~~~
mkswapconf.c: In function ‘nametodev’:
mkswapconf.c:190:17: warning: implicit declaration of function ‘makedev’ [-Wimplicit-function-declaration]
190 | return (makedev(dp->dev_major, (unit << 3) + (partition - 'a' + 1)));
| ^~~~~~~
gcc -o config config.o main.o lang.o mkioconf.o mkmakefile.o mkglue.o mkheaders.o mkswapconf.o -ll
/usr/bin/ld: main.o:(.bss+0x0): multiple definition of machine'; config.o:(.bss+0x0): first defined here /usr/bin/ld: main.o:(.bss+0x8): multiple definition of machinename'; config.o:(.bss+0x8): first defined here
/usr/bin/ld: main.o:(.bss+0x10): multiple definition of cputype'; config.o:(.bss+0x10): first defined here /usr/bin/ld: main.o:(.bss+0x18): multiple definition of opt'; config.o:(.bss+0x18): first defined here
/usr/bin/ld: main.o:(.bss+0x20): multiple definition of mkopt'; config.o:(.bss+0x20): first defined here /usr/bin/ld: main.o:(.bss+0x28): multiple definition of siglist'; config.o:(.bss+0x28): first defined here
/usr/bin/ld: main.o:(.bss+0x30): multiple definition of ident'; config.o:(.bss+0x30): first defined here /usr/bin/ld: main.o:(.bss+0x38): multiple definition of ldscript'; config.o:(.bss+0x38): first defined here
/usr/bin/ld: main.o:(.bss+0x40): multiple definition of do_trace'; config.o:(.bss+0x40): first defined here /usr/bin/ld: main.o:(.bss+0x44): multiple definition of seen_mba'; config.o:(.bss+0x44): first defined here
/usr/bin/ld: main.o:(.bss+0x48): multiple definition of seen_uba'; config.o:(.bss+0x48): first defined here /usr/bin/ld: main.o:(.bss+0x4c): multiple definition of seen_vba'; config.o:(.bss+0x4c): first defined here
/usr/bin/ld: main.o:(.bss+0x50): multiple definition of seen_isa'; config.o:(.bss+0x50): first defined here /usr/bin/ld: main.o:(.bss+0x54): multiple definition of seen_cd'; config.o:(.bss+0x54): first defined here
/usr/bin/ld: main.o:(.bss+0x58): multiple definition of dtab'; config.o:(.bss+0x58): first defined here /usr/bin/ld: main.o:(.bss+0x60): multiple definition of errbuf'; config.o:(.bss+0x60): first defined here
/usr/bin/ld: main.o:(.bss+0xb0): multiple definition of yyline'; config.o:(.bss+0xb0): first defined here /usr/bin/ld: main.o:(.bss+0xb8): multiple definition of ftab'; config.o:(.bss+0xb8): first defined here
/usr/bin/ld: main.o:(.bss+0xc0): multiple definition of conf_list'; config.o:(.bss+0xc0): first defined here /usr/bin/ld: main.o:(.bss+0xc8): multiple definition of confp'; config.o:(.bss+0xc8): first defined here
/usr/bin/ld: main.o:(.bss+0xd0): multiple definition of comp_list'; config.o:(.bss+0xd0): first defined here /usr/bin/ld: main.o:(.bss+0xd8): multiple definition of compp'; config.o:(.bss+0xd8): first defined here
/usr/bin/ld: main.o:(.bss+0xe0): multiple definition of zone'; config.o:(.bss+0xe0): first defined here /usr/bin/ld: main.o:(.bss+0xe4): multiple definition of hadtz'; config.o:(.bss+0xe4): first defined here
/usr/bin/ld: main.o:(.bss+0xe8): multiple definition of dst'; config.o:(.bss+0xe8): first defined here /usr/bin/ld: main.o:(.bss+0xec): multiple definition of hz'; config.o:(.bss+0xec): first defined here
/usr/bin/ld: main.o:(.bss+0xf0): multiple definition of profiling'; config.o:(.bss+0xf0): first defined here /usr/bin/ld: main.o:(.bss+0xf4): multiple definition of debugging'; config.o:(.bss+0xf4): first defined here
/usr/bin/ld: main.o:(.bss+0xf8): multiple definition of maxusers'; config.o:(.bss+0xf8): first defined here /usr/bin/ld: lang.o:(.bss+0x28): multiple definition of machine'; config.o:(.bss+0x0): first defined here
/usr/bin/ld: lang.o:(.bss+0x30): multiple definition of machinename'; config.o:(.bss+0x8): first defined here /usr/bin/ld: lang.o:(.bss+0x38): multiple definition of cputype'; config.o:(.bss+0x10): first defined here
/usr/bin/ld: lang.o:(.bss+0x40): multiple definition of opt'; config.o:(.bss+0x18): first defined here /usr/bin/ld: lang.o:(.bss+0x48): multiple definition of mkopt'; config.o:(.bss+0x20): first defined here
/usr/bin/ld: lang.o:(.bss+0x50): multiple definition of siglist'; config.o:(.bss+0x28): first defined here /usr/bin/ld: lang.o:(.bss+0x58): multiple definition of ident'; config.o:(.bss+0x30): first defined here
/usr/bin/ld: lang.o:(.bss+0x60): multiple definition of ldscript'; config.o:(.bss+0x38): first defined here /usr/bin/ld: lang.o:(.bss+0x68): multiple definition of do_trace'; config.o:(.bss+0x40): first defined here
/usr/bin/ld: lang.o:(.bss+0x6c): multiple definition of seen_mba'; config.o:(.bss+0x44): first defined here /usr/bin/ld: lang.o:(.bss+0x70): multiple definition of seen_uba'; config.o:(.bss+0x48): first defined here
/usr/bin/ld: lang.o:(.bss+0x74): multiple definition of seen_vba'; config.o:(.bss+0x4c): first defined here /usr/bin/ld: lang.o:(.bss+0x78): multiple definition of seen_isa'; config.o:(.bss+0x50): first defined here
/usr/bin/ld: lang.o:(.bss+0x7c): multiple definition of seen_cd'; config.o:(.bss+0x54): first defined here /usr/bin/ld: lang.o:(.bss+0x80): multiple definition of dtab'; config.o:(.bss+0x58): first defined here
/usr/bin/ld: lang.o:(.bss+0xa0): multiple definition of errbuf'; config.o:(.bss+0x60): first defined here /usr/bin/ld: lang.o:(.bss+0xf0): multiple definition of yyline'; config.o:(.bss+0xb0): first defined here
/usr/bin/ld: lang.o:(.bss+0xf8): multiple definition of ftab'; config.o:(.bss+0xb8): first defined here /usr/bin/ld: lang.o:(.bss+0x100): multiple definition of conf_list'; config.o:(.bss+0xc0): first defined here
/usr/bin/ld: lang.o:(.bss+0x108): multiple definition of confp'; config.o:(.bss+0xc8): first defined here /usr/bin/ld: lang.o:(.bss+0x110): multiple definition of comp_list'; config.o:(.bss+0xd0): first defined here
/usr/bin/ld: lang.o:(.bss+0x118): multiple definition of compp'; config.o:(.bss+0xd8): first defined here /usr/bin/ld: lang.o:(.bss+0x120): multiple definition of zone'; config.o:(.bss+0xe0): first defined here
/usr/bin/ld: lang.o:(.bss+0x124): multiple definition of hadtz'; config.o:(.bss+0xe4): first defined here /usr/bin/ld: lang.o:(.bss+0x128): multiple definition of dst'; config.o:(.bss+0xe8): first defined here
/usr/bin/ld: lang.o:(.bss+0x12c): multiple definition of hz'; config.o:(.bss+0xec): first defined here /usr/bin/ld: lang.o:(.bss+0x130): multiple definition of profiling'; config.o:(.bss+0xf0): first defined here
/usr/bin/ld: lang.o:(.bss+0x134): multiple definition of debugging'; config.o:(.bss+0xf4): first defined here /usr/bin/ld: lang.o:(.bss+0x138): multiple definition of maxusers'; config.o:(.bss+0xf8): first defined here
/usr/bin/ld: mkioconf.o:(.bss+0x0): multiple definition of machine'; config.o:(.bss+0x0): first defined here /usr/bin/ld: mkioconf.o:(.bss+0x8): multiple definition of machinename'; config.o:(.bss+0x8): first defined here
/usr/bin/ld: mkioconf.o:(.bss+0x10): multiple definition of cputype'; config.o:(.bss+0x10): first defined here /usr/bin/ld: mkioconf.o:(.bss+0x18): multiple definition of opt'; config.o:(.bss+0x18): first defined here
/usr/bin/ld: mkioconf.o:(.bss+0x20): multiple definition of mkopt'; config.o:(.bss+0x20): first defined here /usr/bin/ld: mkioconf.o:(.bss+0x28): multiple definition of siglist'; config.o:(.bss+0x28): first defined here
/usr/bin/ld: mkioconf.o:(.bss+0x30): multiple definition of ident'; config.o:(.bss+0x30): first defined here /usr/bin/ld: mkioconf.o:(.bss+0x38): multiple definition of ldscript'; config.o:(.bss+0x38): first defined here
/usr/bin/ld: mkioconf.o:(.bss+0x40): multiple definition of do_trace'; config.o:(.bss+0x40): first defined here /usr/bin/ld: mkioconf.o:(.bss+0x44): multiple definition of seen_mba'; config.o:(.bss+0x44): first defined here
/usr/bin/ld: mkioconf.o:(.bss+0x48): multiple definition of seen_uba'; config.o:(.bss+0x48): first defined here /usr/bin/ld: mkioconf.o:(.bss+0x4c): multiple definition of seen_vba'; config.o:(.bss+0x4c): first defined here
/usr/bin/ld: mkioconf.o:(.bss+0x50): multiple definition of seen_isa'; config.o:(.bss+0x50): first defined here /usr/bin/ld: mkioconf.o:(.bss+0x54): multiple definition of seen_cd'; config.o:(.bss+0x54): first defined here
/usr/bin/ld: mkioconf.o:(.bss+0x58): multiple definition of dtab'; config.o:(.bss+0x58): first defined here /usr/bin/ld: mkioconf.o:(.bss+0x60): multiple definition of errbuf'; config.o:(.bss+0x60): first defined here
/usr/bin/ld: mkioconf.o:(.bss+0xb0): multiple definition of yyline'; config.o:(.bss+0xb0): first defined here /usr/bin/ld: mkioconf.o:(.bss+0xb8): multiple definition of ftab'; config.o:(.bss+0xb8): first defined here
/usr/bin/ld: mkioconf.o:(.bss+0xc0): multiple definition of conf_list'; config.o:(.bss+0xc0): first defined here /usr/bin/ld: mkioconf.o:(.bss+0xc8): multiple definition of confp'; config.o:(.bss+0xc8): first defined here
/usr/bin/ld: mkioconf.o:(.bss+0xd0): multiple definition of comp_list'; config.o:(.bss+0xd0): first defined here /usr/bin/ld: mkioconf.o:(.bss+0xd8): multiple definition of compp'; config.o:(.bss+0xd8): first defined here
/usr/bin/ld: mkioconf.o:(.bss+0xe0): multiple definition of zone'; config.o:(.bss+0xe0): first defined here /usr/bin/ld: mkioconf.o:(.bss+0xe4): multiple definition of hadtz'; config.o:(.bss+0xe4): first defined here
/usr/bin/ld: mkioconf.o:(.bss+0xe8): multiple definition of dst'; config.o:(.bss+0xe8): first defined here /usr/bin/ld: mkioconf.o:(.bss+0xec): multiple definition of hz'; config.o:(.bss+0xec): first defined here
/usr/bin/ld: mkioconf.o:(.bss+0xf0): multiple definition of profiling'; config.o:(.bss+0xf0): first defined here /usr/bin/ld: mkioconf.o:(.bss+0xf4): multiple definition of debugging'; config.o:(.bss+0xf4): first defined here
/usr/bin/ld: mkioconf.o:(.bss+0xf8): multiple definition of maxusers'; config.o:(.bss+0xf8): first defined here /usr/bin/ld: mkmakefile.o:(.bss+0x0): multiple definition of machine'; config.o:(.bss+0x0): first defined here
/usr/bin/ld: mkmakefile.o:(.bss+0x8): multiple definition of machinename'; config.o:(.bss+0x8): first defined here /usr/bin/ld: mkmakefile.o:(.bss+0x10): multiple definition of cputype'; config.o:(.bss+0x10): first defined here
/usr/bin/ld: mkmakefile.o:(.bss+0x18): multiple definition of opt'; config.o:(.bss+0x18): first defined here /usr/bin/ld: mkmakefile.o:(.bss+0x20): multiple definition of mkopt'; config.o:(.bss+0x20): first defined here
/usr/bin/ld: mkmakefile.o:(.bss+0x28): multiple definition of siglist'; config.o:(.bss+0x28): first defined here /usr/bin/ld: mkmakefile.o:(.bss+0x30): multiple definition of ident'; config.o:(.bss+0x30): first defined here
/usr/bin/ld: mkmakefile.o:(.bss+0x38): multiple definition of ldscript'; config.o:(.bss+0x38): first defined here /usr/bin/ld: mkmakefile.o:(.bss+0x40): multiple definition of do_trace'; config.o:(.bss+0x40): first defined here
/usr/bin/ld: mkmakefile.o:(.bss+0x44): multiple definition of seen_mba'; config.o:(.bss+0x44): first defined here /usr/bin/ld: mkmakefile.o:(.bss+0x48): multiple definition of seen_uba'; config.o:(.bss+0x48): first defined here
/usr/bin/ld: mkmakefile.o:(.bss+0x4c): multiple definition of seen_vba'; config.o:(.bss+0x4c): first defined here /usr/bin/ld: mkmakefile.o:(.bss+0x50): multiple definition of seen_isa'; config.o:(.bss+0x50): first defined here
/usr/bin/ld: mkmakefile.o:(.bss+0x54): multiple definition of seen_cd'; config.o:(.bss+0x54): first defined here /usr/bin/ld: mkmakefile.o:(.bss+0x58): multiple definition of dtab'; config.o:(.bss+0x58): first defined here
/usr/bin/ld: mkmakefile.o:(.bss+0x60): multiple definition of errbuf'; config.o:(.bss+0x60): first defined here /usr/bin/ld: mkmakefile.o:(.bss+0xb0): multiple definition of yyline'; config.o:(.bss+0xb0): first defined here
/usr/bin/ld: mkmakefile.o:(.bss+0xb8): multiple definition of ftab'; config.o:(.bss+0xb8): first defined here /usr/bin/ld: mkmakefile.o:(.bss+0xc0): multiple definition of conf_list'; config.o:(.bss+0xc0): first defined here
/usr/bin/ld: mkmakefile.o:(.bss+0xc8): multiple definition of confp'; config.o:(.bss+0xc8): first defined here /usr/bin/ld: mkmakefile.o:(.bss+0xd0): multiple definition of comp_list'; config.o:(.bss+0xd0): first defined here
/usr/bin/ld: mkmakefile.o:(.bss+0xd8): multiple definition of compp'; config.o:(.bss+0xd8): first defined here /usr/bin/ld: mkmakefile.o:(.bss+0xe0): multiple definition of zone'; config.o:(.bss+0xe0): first defined here
/usr/bin/ld: mkmakefile.o:(.bss+0xe4): multiple definition of hadtz'; config.o:(.bss+0xe4): first defined here /usr/bin/ld: mkmakefile.o:(.bss+0xe8): multiple definition of dst'; config.o:(.bss+0xe8): first defined here
/usr/bin/ld: mkmakefile.o:(.bss+0xec): multiple definition of hz'; config.o:(.bss+0xec): first defined here /usr/bin/ld: mkmakefile.o:(.bss+0xf0): multiple definition of profiling'; config.o:(.bss+0xf0): first defined here
/usr/bin/ld: mkmakefile.o:(.bss+0xf4): multiple definition of debugging'; config.o:(.bss+0xf4): first defined here /usr/bin/ld: mkmakefile.o:(.bss+0xf8): multiple definition of maxusers'; config.o:(.bss+0xf8): first defined here
/usr/bin/ld: mkglue.o:(.bss+0x0): multiple definition of machine'; config.o:(.bss+0x0): first defined here /usr/bin/ld: mkglue.o:(.bss+0x8): multiple definition of machinename'; config.o:(.bss+0x8): first defined here
/usr/bin/ld: mkglue.o:(.bss+0x10): multiple definition of cputype'; config.o:(.bss+0x10): first defined here /usr/bin/ld: mkglue.o:(.bss+0x18): multiple definition of opt'; config.o:(.bss+0x18): first defined here
/usr/bin/ld: mkglue.o:(.bss+0x20): multiple definition of mkopt'; config.o:(.bss+0x20): first defined here /usr/bin/ld: mkglue.o:(.bss+0x28): multiple definition of siglist'; config.o:(.bss+0x28): first defined here
/usr/bin/ld: mkglue.o:(.bss+0x30): multiple definition of ident'; config.o:(.bss+0x30): first defined here /usr/bin/ld: mkglue.o:(.bss+0x38): multiple definition of ldscript'; config.o:(.bss+0x38): first defined here
/usr/bin/ld: mkglue.o:(.bss+0x40): multiple definition of do_trace'; config.o:(.bss+0x40): first defined here /usr/bin/ld: mkglue.o:(.bss+0x44): multiple definition of seen_mba'; config.o:(.bss+0x44): first defined here
/usr/bin/ld: mkglue.o:(.bss+0x48): multiple definition of seen_uba'; config.o:(.bss+0x48): first defined here /usr/bin/ld: mkglue.o:(.bss+0x4c): multiple definition of seen_vba'; config.o:(.bss+0x4c): first defined here
/usr/bin/ld: mkglue.o:(.bss+0x50): multiple definition of seen_isa'; config.o:(.bss+0x50): first defined here /usr/bin/ld: mkglue.o:(.bss+0x54): multiple definition of seen_cd'; config.o:(.bss+0x54): first defined here
/usr/bin/ld: mkglue.o:(.bss+0x58): multiple definition of dtab'; config.o:(.bss+0x58): first defined here /usr/bin/ld: mkglue.o:(.bss+0x60): multiple definition of errbuf'; config.o:(.bss+0x60): first defined here
/usr/bin/ld: mkglue.o:(.bss+0xb0): multiple definition of yyline'; config.o:(.bss+0xb0): first defined here /usr/bin/ld: mkglue.o:(.bss+0xb8): multiple definition of ftab'; config.o:(.bss+0xb8): first defined here
/usr/bin/ld: mkglue.o:(.bss+0xc0): multiple definition of conf_list'; config.o:(.bss+0xc0): first defined here /usr/bin/ld: mkglue.o:(.bss+0xc8): multiple definition of confp'; config.o:(.bss+0xc8): first defined here
/usr/bin/ld: mkglue.o:(.bss+0xd0): multiple definition of comp_list'; config.o:(.bss+0xd0): first defined here /usr/bin/ld: mkglue.o:(.bss+0xd8): multiple definition of compp'; config.o:(.bss+0xd8): first defined here
/usr/bin/ld: mkglue.o:(.bss+0xe0): multiple definition of zone'; config.o:(.bss+0xe0): first defined here /usr/bin/ld: mkglue.o:(.bss+0xe4): multiple definition of hadtz'; config.o:(.bss+0xe4): first defined here
/usr/bin/ld: mkglue.o:(.bss+0xe8): multiple definition of dst'; config.o:(.bss+0xe8): first defined here /usr/bin/ld: mkglue.o:(.bss+0xec): multiple definition of hz'; config.o:(.bss+0xec): first defined here
/usr/bin/ld: mkglue.o:(.bss+0xf0): multiple definition of profiling'; config.o:(.bss+0xf0): first defined here /usr/bin/ld: mkglue.o:(.bss+0xf4): multiple definition of debugging'; config.o:(.bss+0xf4): first defined here
/usr/bin/ld: mkglue.o:(.bss+0xf8): multiple definition of maxusers'; config.o:(.bss+0xf8): first defined here /usr/bin/ld: mkheaders.o:(.bss+0x0): multiple definition of machine'; config.o:(.bss+0x0): first defined here
/usr/bin/ld: mkheaders.o:(.bss+0x8): multiple definition of machinename'; config.o:(.bss+0x8): first defined here /usr/bin/ld: mkheaders.o:(.bss+0x10): multiple definition of cputype'; config.o:(.bss+0x10): first defined here
/usr/bin/ld: mkheaders.o:(.bss+0x18): multiple definition of opt'; config.o:(.bss+0x18): first defined here /usr/bin/ld: mkheaders.o:(.bss+0x20): multiple definition of mkopt'; config.o:(.bss+0x20): first defined here
/usr/bin/ld: mkheaders.o:(.bss+0x28): multiple definition of siglist'; config.o:(.bss+0x28): first defined here /usr/bin/ld: mkheaders.o:(.bss+0x30): multiple definition of ident'; config.o:(.bss+0x30): first defined here
/usr/bin/ld: mkheaders.o:(.bss+0x38): multiple definition of ldscript'; config.o:(.bss+0x38): first defined here /usr/bin/ld: mkheaders.o:(.bss+0x40): multiple definition of do_trace'; config.o:(.bss+0x40): first defined here
/usr/bin/ld: mkheaders.o:(.bss+0x44): multiple definition of seen_mba'; config.o:(.bss+0x44): first defined here /usr/bin/ld: mkheaders.o:(.bss+0x48): multiple definition of seen_uba'; config.o:(.bss+0x48): first defined here
/usr/bin/ld: mkheaders.o:(.bss+0x4c): multiple definition of seen_vba'; config.o:(.bss+0x4c): first defined here /usr/bin/ld: mkheaders.o:(.bss+0x50): multiple definition of seen_isa'; config.o:(.bss+0x50): first defined here
/usr/bin/ld: mkheaders.o:(.bss+0x54): multiple definition of seen_cd'; config.o:(.bss+0x54): first defined here /usr/bin/ld: mkheaders.o:(.bss+0x58): multiple definition of dtab'; config.o:(.bss+0x58): first defined here
/usr/bin/ld: mkheaders.o:(.bss+0x60): multiple definition of errbuf'; config.o:(.bss+0x60): first defined here /usr/bin/ld: mkheaders.o:(.bss+0xb0): multiple definition of yyline'; config.o:(.bss+0xb0): first defined here
/usr/bin/ld: mkheaders.o:(.bss+0xb8): multiple definition of ftab'; config.o:(.bss+0xb8): first defined here /usr/bin/ld: mkheaders.o:(.bss+0xc0): multiple definition of conf_list'; config.o:(.bss+0xc0): first defined here
/usr/bin/ld: mkheaders.o:(.bss+0xc8): multiple definition of confp'; config.o:(.bss+0xc8): first defined here /usr/bin/ld: mkheaders.o:(.bss+0xd0): multiple definition of comp_list'; config.o:(.bss+0xd0): first defined here
/usr/bin/ld: mkheaders.o:(.bss+0xd8): multiple definition of compp'; config.o:(.bss+0xd8): first defined here /usr/bin/ld: mkheaders.o:(.bss+0xe0): multiple definition of zone'; config.o:(.bss+0xe0): first defined here
/usr/bin/ld: mkheaders.o:(.bss+0xe4): multiple definition of hadtz'; config.o:(.bss+0xe4): first defined here /usr/bin/ld: mkheaders.o:(.bss+0xe8): multiple definition of dst'; config.o:(.bss+0xe8): first defined here
/usr/bin/ld: mkheaders.o:(.bss+0xec): multiple definition of hz'; config.o:(.bss+0xec): first defined here /usr/bin/ld: mkheaders.o:(.bss+0xf0): multiple definition of profiling'; config.o:(.bss+0xf0): first defined here
/usr/bin/ld: mkheaders.o:(.bss+0xf4): multiple definition of debugging'; config.o:(.bss+0xf4): first defined here /usr/bin/ld: mkheaders.o:(.bss+0xf8): multiple definition of maxusers'; config.o:(.bss+0xf8): first defined here
/usr/bin/ld: mkswapconf.o:(.bss+0x0): multiple definition of machine'; config.o:(.bss+0x0): first defined here /usr/bin/ld: mkswapconf.o:(.bss+0x8): multiple definition of machinename'; config.o:(.bss+0x8): first defined here
/usr/bin/ld: mkswapconf.o:(.bss+0x10): multiple definition of cputype'; config.o:(.bss+0x10): first defined here /usr/bin/ld: mkswapconf.o:(.bss+0x18): multiple definition of opt'; config.o:(.bss+0x18): first defined here
/usr/bin/ld: mkswapconf.o:(.bss+0x20): multiple definition of mkopt'; config.o:(.bss+0x20): first defined here /usr/bin/ld: mkswapconf.o:(.bss+0x28): multiple definition of siglist'; config.o:(.bss+0x28): first defined here
/usr/bin/ld: mkswapconf.o:(.bss+0x30): multiple definition of ident'; config.o:(.bss+0x30): first defined here /usr/bin/ld: mkswapconf.o:(.bss+0x38): multiple definition of ldscript'; config.o:(.bss+0x38): first defined here
/usr/bin/ld: mkswapconf.o:(.bss+0x40): multiple definition of do_trace'; config.o:(.bss+0x40): first defined here /usr/bin/ld: mkswapconf.o:(.bss+0x44): multiple definition of seen_mba'; config.o:(.bss+0x44): first defined here
/usr/bin/ld: mkswapconf.o:(.bss+0x48): multiple definition of seen_uba'; config.o:(.bss+0x48): first defined here /usr/bin/ld: mkswapconf.o:(.bss+0x4c): multiple definition of seen_vba'; config.o:(.bss+0x4c): first defined here
/usr/bin/ld: mkswapconf.o:(.bss+0x50): multiple definition of seen_isa'; config.o:(.bss+0x50): first defined here /usr/bin/ld: mkswapconf.o:(.bss+0x54): multiple definition of seen_cd'; config.o:(.bss+0x54): first defined here
/usr/bin/ld: mkswapconf.o:(.bss+0x58): multiple definition of dtab'; config.o:(.bss+0x58): first defined here /usr/bin/ld: mkswapconf.o:(.bss+0x60): multiple definition of errbuf'; config.o:(.bss+0x60): first defined here
/usr/bin/ld: mkswapconf.o:(.bss+0xb0): multiple definition of yyline'; config.o:(.bss+0xb0): first defined here /usr/bin/ld: mkswapconf.o:(.bss+0xb8): multiple definition of ftab'; config.o:(.bss+0xb8): first defined here
/usr/bin/ld: mkswapconf.o:(.bss+0xc0): multiple definition of conf_list'; config.o:(.bss+0xc0): first defined here /usr/bin/ld: mkswapconf.o:(.bss+0xc8): multiple definition of confp'; config.o:(.bss+0xc8): first defined here
/usr/bin/ld: mkswapconf.o:(.bss+0xd0): multiple definition of comp_list'; config.o:(.bss+0xd0): first defined here /usr/bin/ld: mkswapconf.o:(.bss+0xd8): multiple definition of compp'; config.o:(.bss+0xd8): first defined here
/usr/bin/ld: mkswapconf.o:(.bss+0xe0): multiple definition of zone'; config.o:(.bss+0xe0): first defined here /usr/bin/ld: mkswapconf.o:(.bss+0xe4): multiple definition of hadtz'; config.o:(.bss+0xe4): first defined here
/usr/bin/ld: mkswapconf.o:(.bss+0xe8): multiple definition of dst'; config.o:(.bss+0xe8): first defined here /usr/bin/ld: mkswapconf.o:(.bss+0xec): multiple definition of hz'; config.o:(.bss+0xec): first defined here
/usr/bin/ld: mkswapconf.o:(.bss+0xf0): multiple definition of profiling'; config.o:(.bss+0xf0): first defined here /usr/bin/ld: mkswapconf.o:(.bss+0xf4): multiple definition of debugging'; config.o:(.bss+0xf4): first defined here
/usr/bin/ld: mkswapconf.o:(.bss+0xf8): multiple definition of maxusers'; config.o:(.bss+0xf8): first defined here /usr/bin/ld: config.o: in function checksystemspec':
config.c:(.text+0xb4d): undefined reference to minor' /usr/bin/ld: config.c:(.text+0xb68): undefined reference to minor'
/usr/bin/ld: config.c:(.text+0xbb4): undefined reference to minor' /usr/bin/ld: config.c:(.text+0xbd1): undefined reference to major'
/usr/bin/ld: config.c:(.text+0xbe0): undefined reference to makedev' /usr/bin/ld: config.o: in function alreadychecked':
config.c:(.text+0xf92): undefined reference to minor' /usr/bin/ld: config.c:(.text+0xfa6): undefined reference to minor'
/usr/bin/ld: config.o: in function yyparse': config.c:(.text+0x1f05): undefined reference to makedev'
/usr/bin/ld: mkswapconf.o: in function do_swap': mkswapconf.c:(.text+0x1af): undefined reference to minor'
/usr/bin/ld: mkswapconf.c:(.text+0x1c4): undefined reference to major' /usr/bin/ld: mkswapconf.c:(.text+0x1f6): undefined reference to minor'
/usr/bin/ld: mkswapconf.c:(.text+0x20b): undefined reference to major' /usr/bin/ld: mkswapconf.c:(.text+0x28d): undefined reference to minor'
/usr/bin/ld: mkswapconf.c:(.text+0x2a4): undefined reference to major' /usr/bin/ld: mkswapconf.o: in function nametodev':
mkswapconf.c:(.text+0x6d9): undefined reference to makedev' /usr/bin/ld: mkswapconf.o: in function devtoname':
mkswapconf.c:(.text+0x731): undefined reference to major' /usr/bin/ld: mkswapconf.c:(.text+0x761): undefined reference to minor'
/usr/bin/ld: mkswapconf.c:(.text+0x779): undefined reference to `minor'
collect2: error: ld returned 1 exit status
*** Error code 1

Stop.
bmake[2]: stopped in /mnt/d/Development/LiteBSD/usr.sbin/config
*** Error code 1

Stop.
bmake[1]: stopped in /mnt/d/Development/LiteBSD/sys/compile
*** Error code 1

Stop.
bmake: stopped in /mnt/d/Development/LiteBSD

'make install' failure in share/mk

===> mk
install -d /usr/share/mk
install -c -m 444 bsd.doc.mk bsd.lib.mk bsd.man.mk bsd.prog.mk bsd.subdir.mk sys.mk /usr/share
install: cannot remove ‘/usr/share/mk/bsd.doc.mk’: Permission denied
install: cannot remove ‘/usr/share/mk/bsd.lib.mk’: Permission denied
install: cannot remove ‘/usr/share/mk/bsd.man.mk’: Permission denied
install: cannot remove ‘/usr/share/mk/bsd.prog.mk’: Permission denied
install: cannot remove ‘/usr/share/mk/bsd.subdir.mk’: Permission denied
install: cannot remove ‘/usr/share/mk/sys.mk’: Permission denied
*** Error code 1

Stop.
bmake[3]: stopped in /home/vak/LiteBSD/share/mk

Hangup, and 'no SD card detected' after reset

Sometimes the system hangs up, and when restarted using Reset button, the kernel fails to boot up with message:

sd0: no SD card detected

Seems like a bug in sd driver. Wrong timing or something.

`reboot` doesn't.

Typing reboot causes the shell to be logged out, then getty to repeatedly die and respawn. A reboot never seems to happen.

#! not working properly

The #! magic number isn't working properly.
When writing lua scripts that begin with
#!/usr/bin/lua
you would expect the lua interpreter to be used.
Instead, the OS tries to use ksh, which doesn't work.
(And yes, /usr/bin/lua is the correct path)

as(1) instructions to work with pcc(1) (and lcc)

as(1) doesn't seem to support the following pseudo-instructions, which pcc(1) emits:
.p2align
sw $fp, ($sp) syntax: sw $fp, 4($sp) works but sw $fp, ($sp) does not.
.extern (lcc emits this)

pkg - develop a new package management utility

For LiteBSD, we need a package management utility, similar to Debian's "apt" or OpenWrt "opkg" tool. Here is a brief list of requirements:

  1. BSD or MIT or Apache license.
  2. Small memory footprint.
  3. Allow multiple remote repositories.
  4. The name can be "pkg" or something like "pak" or "pac".
  5. No need for source packages.
  6. No need for package development services. Packages can be built by other tools.
  7. Keep the list of repositories in /etc directory, like "/etc/pkg/sources.list"
  8. Store the configuration parameters in "/etc/pkg/pkg.conf" file. Consider JSON as a format for *.conf files.
  9. Store the local database in "/var/lib/pkg/" directory.
  10. "pkg update" - update the list of package known by your system. Fetch lists from remote repositories.
  11. "pkg upgrade" - upgrade all the packages already installed on your system. Fetch and install new versions of packages from remote repositories (without installing extra packages or removing packages).
  12. "pkg install foo" - install the foo package and all its dependencies.
  13. "pkg remove foo" - remove the foo package from your system.
  14. "pkg search word" - find packages whose description contain word.
  15. "pkg show foo" - print the detailed information of a package (not yet installed). Include the versions available for a package, the packages a given package depends on, and the packages that reverse-depend on it.
  16. "pkg status foo" - get a report on a particular installed package, including a list of all the files provided by the package foo.
  17. "pkg list" - print a list of all the packages installed on your system.

RISC-V support like CH32V307 MCU

Hi,

Last year it was launched to the market the MCU CH32V307, which has the following features:

CH32V307

The CH32V305 and CH32V307 are interconnected microcontrollers, based on 32-bit RISC-V core, with hardware stack area and fast interrupt entry. Compared with standard RISC-V, the interrupt response speed is greatly improved. With single-precision float point instruction sets added and stack area extended, the CH32V305/7 has higher performance, the number of U(S)ART is extended to 8, and the number of motor timer is extended to 4. The CH32V305/7 provides USB2.0 high-speed interface (480Mbps) and has built-in PHY transceiver. Ethernet MAC is upgraded to GbE and integrates 10M PHY module.

http://www.wch-ic.com/products/CH32V307.html

Resources are available on GitHub and GitLab:

Even there's also a WCH Kicad Library on the way:

https://github.com/sad-electronics/wch-kicad-lbr

2 PCBs which are available on the market:

  1. https://www.aliexpress.com/item/1005004329125620.html
  2. https://www.aliexpress.com/item/1005004367173443.html

Could be a good option have a LiteBSD port for it?

Thank you.

Kind regards,

FPU support

The PIC32MZ has an FPU. LiteBSD should support it. Then we can turn off -msoft-float in the build and have better performance.

va_args bug

Trying to do some debugging of pcc, found some code that even gcc doesn't compile correctly. It originally comes from the gcc mailing list: https://gcc.gnu.org/ml/gcc-bugs/2000-01/msg00696.html
The code in question is available here: https://devio.us/~bcallah/vtest.tgz (you can untar it into the contrib/ directory and run bmake for easy compilation)

For comparison, on NetBSD/i386, it does the right thing:

*
* Simple stdarg test.
*
  # of args:6
       int: expected: -1,      passed: -1
      char: expected:  2,      passed:  2
 long long: expected: -3,      passed: -3
    string: expected:  4,      passed:  4
       int: expected: -5,      passed: -5
      char: expected:  6,      passed:  6
OK

Here's the code when run on LiteBSD, compiled with gcc:

*
* Simple stdarg test.
*
  # of args:6
       int: expected: -1,      passed: -1
      char: expected:  2,      passed:  0
 long long: expected: -3,      passed: -1
    string: expected:  4,      passed:  0
       int: expected: -5,      passed: -1
      char: expected:  6,      passed:  0
OK

(Yes, it really offers an OK even though it fails.)

And finally, here's the same code on LiteBSD, compiled with pcc:

*
* Simple stdarg test.
*
  # of args:6
       int: expected:  0,      passed:  0
      char: expected:  2,      passed:  0
 long long: expected:  0,      passed:  0
    string: expected:  4,      passed:  0
       int: expected:  0,      passed:  0
      char: expected:  6,      passed:  0
NG

(NG = no good)

Support for ESP32

Can this OS port to ESP32
it has toolchain and MMU which is required
and support for updates from company

`fdisk` utility: need to port from NetBSD or Linux

Need to port fdisk utility from somewhere.

I removed all the traditional disklabel stuff from the kernel. We don't need any disklabels anymore. Standard MS-DOS compatible disk partition is enough. I propose to use BSDI values for partition type, namely b7 and b8.

Zoneinfo failing to compile (breaks subsequent termcap installation)

Zoneinfo is failing to compile - missing sys/types.h. As a result "bmake install" on share fails which means /usr/share/misc/termcap (etc) are not installed.

===> zoneinfo
gcc -m32 -O -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone -Werror -c zic.c
zic.c:45:23: fatal error: sys/types.h: No such file or directory
 #include <sys/types.h>
                       ^
compilation terminated.
*** Error code 1

PIC32-EMZ64 virtual com port

Hi,

I have played with retrobsd with good success, but just start to try litebsd. I purchased a PIC32-EMZ64 and programmed flash and sd card. However, when I restart the system, no virtual com port shows up. How do I connect a console, or is the virtual com not enabled?

regards,

Macrcel

`fsck` prints wrong number of files

When filesystem check completed, fsck prints a line:

/dev/rsd0a: 4374720 files, 2240 used, 0 free (0 frags, 0 blocks, 0.36597% fragmentation)

Here, the number 4374720 is wrong.

Error compiling kernel ""minor" "major"

Hi all,
trying to compile the kernel and getting error:

:~/LiteBSD$ bmake kernel
bmake -Csys/compile all
bmake -C../../usr.sbin/config
byacc -d config.y
byacc: w - the symbol SIGNAL is undefined
byacc: 12 reduce/reduce conflicts.
mv y.tab.c config.c
gcc  -Werror -c config.c
config.y: In function ‘checksystemspec’:
config.y:1003:13: error: In the GNU C Library, "minor" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "minor", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "minor", you should undefine it after including <sys/types.h>. [-Werror]
   if (minor(dev) & 07) {
             ^~~~~~~~~~~~                                                                                                                                                                                                                                                                                                                             
config.y:1006:13: error: In the GNU C Library, "minor" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "minor", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "minor", you should undefine it after including <sys/types.h>. [-Werror]
     (minor(dev) & 07) + 'a' - 1);
             ^~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                                                                                                                                                    
config.y:1010:13: error: In the GNU C Library, "major" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "major", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "major", you should undefine it after including <sys/types.h>. [-Werror]
      makedev(major(dev), (minor(dev) &~ 07) | ('b' - 'a' + 1));
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                                                                                                                      
config.y:1010:13: error: In the GNU C Library, "minor" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "minor", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "minor", you should undefine it after including <sys/types.h>. [-Werror]
config.y:1010:13: error: In the GNU C Library, "makedev" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "makedev", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "makedev", you should undefine it after including <sys/types.h>. [-Werror]
      makedev(major(dev), (minor(dev) &~ 07) | ('b' - 'a' + 1));
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                                                                                                                      
config.y: In function ‘alreadychecked’:
config.y:1121:13: error: In the GNU C Library, "minor" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "minor", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "minor", you should undefine it after including <sys/types.h>. [-Werror]
   if (samedev(*p, dev))
             ^~~~~~~~~~~                                                                                                                                                                                                                                                                                                                              
config.y:1121:13: error: In the GNU C Library, "minor" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "minor", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "minor", you should undefine it after including <sys/types.h>. [-Werror]
config.y: In function ‘yyparse’:
config.y:353:13: error: In the GNU C Library, "makedev" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "makedev", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "makedev", you should undefine it after including <sys/types.h>. [-Werror]
   = { $$ = makedev($2, $4); }
             ^~~~~~~~~~~~~~~~~                                                                                                                                                                                                                                                                                                                        
cc1: all warnings being treated as errors
*** Error code 1

Stop.
bmake[2]: stopped in /home/xx/LiteBSD/usr.sbin/config
*** Error code 1

Stop.
bmake[1]: stopped in /home/xx/LiteBSD/sys/compile
*** Error code 1

Stop.
bmake: stopped in /home/xx/LiteBSD

long long printf fun

We need to update printf to support long long. quad alone isn't enough these days.

Abstract GPIO control

We need to abstract the GPIO control into a kernel driver / function set. At the moment each device that does GPIO manipulation deals with it directly by itself. With an abstraction layer we can also add in /dev access, and have things working together nicely without fighting or code duplication.

Assigning Pins to CAN controller

I'm on the way to write a CAN controller driver for the LiteBSD PIC32MZ on the Olimex PIC32-EMZ64.
May main problem at the moment is assigning the CAN signals CAN-RX and CAN-TX to the correct pins which are according to the schematic RC13 and RC14. I have added the lines in sys/mips/conf/EMZ64.pic32:

# CAN1 C1RX=RC13, C1TX=RC14
device      can1    pins RC13, RC14 # pins rx tx

But the difficulty is the code required in canprobe(). I like to use the code as in mips/dev/uart.c but have problems understanding it.
Someone interested in it and can help?

Heinz

Build failure on Slackware 32bit

Building kernel default build, fails with unresolved symbols such as: strcpy, ffs, __udivdi3,random,skpc
while building SNADPIC.pic32
using mipss-2014.05/mips-sde-elf toolchain.
git rev: 7549ebd

Build failure on Manjaro 64-bit

When I try to build the sd mage I get the following error:

[kpapak@thelxiopi LiteBSD]$ sudo bmake kernel
bmake -Csys/compile all
bmake -C../../usr.sbin/config
bmake[2]: "/home/kpapak/LiteBSD/usr.sbin/config/Makefile" line 12: Could not find local.prog.mk
bmake[2]: Fatal errors encountered -- cannot continue
bmake[2]: stopped in /home/kpapak/LiteBSD/usr.sbin/config
*** Error code 1

Stop.
bmake[1]: stopped in /home/kpapak/LiteBSD/sys/compile
*** Error code 1

Stop.
bmake: stopped in /home/kpapak/LiteBSD

Wrong links and symlinks in rootfs manifest

Current etc/rootfs.manifest file does not correctly create links and symlinks for most files, making copies instead. Need to look over all Makefiles, collect LINKS and MLINKS pairs and modify rootfs.manifest appropriately.

Ethernet driver: avoid extra copying of receive data.

Currently, received data are copied twice: first from RX descriptors to intermediate buffer, and then to mbuf chain. Remove RX buffers, use mbufs of size 512 instead. Assemble received packet as a chain of filled buffers. Copy only small buffers of size 128 and less.

Native toolchain

It would be good for LiteBSD to have a native toolchain. That way it could be self-hosting, we could have a real ports tree (or pkgsrc might be nice too, our ksh is enough to bootstrap pkgsrc).
The minimum toolchain has four parts: a C preprocessor, a C compiler, an assembler, and a linker.

Any and all help appreciated. Let's get LiteBSD self-hosting!

Here's where we are for each:
Preprocessor:
Most C compilers include a preprocessor but there are others out there if we want to use them (search pkgsrc for "cpp" to find some). RetroBSD uses pcpp from pcc. We also use a modified cpp.sh from OpenBSD for /usr/bin/cpp

Compiler:
pcc - compiles, it produces mips1 code only, does PIC (via the assembler), comes with a working preprocessor (pcpp), needs an external assembler and linker, miscompiles anything more complex than a basic program, libpcc works but libsoftfloat does not yet have MIPS support. I have been sending patches to upstream. This would be a good candidate for the system compiler if we can get enough people to work on it for MIPS: it is BSD licensed, a C11 compiler, small, and could potentially rid LiteBSD of its libgcc requirement (via libpcc and libsoftfloat). Does not include a C++ compiler but that is a potential future addition (a cxxcom exists). It appears to write out asm for any random C file I give it and has -msoft-float support. Future improvements would be further optimizations (such as -mips32r2) to make more compact/faster running code.
gcc - the beast is huge, written in C++, might be too big to run on LiteBSD(?), needs a nasty cross-native build to even determine if it would work, which has not been completed. Needs an external assembler and linker, usually GNU binutils. Supports everything. Includes a CPP and a C++ compiler. It is GPLv3 licensed: we could either not care (like NetBSD or DragonFly BSD) or aim to use gcc-4.2.1 (the last GPLv2 release) like OpenBSD does. Always a potential system compiler.
clang - also huge, also written in C++, might also be too big to run on LiteBSD: no work has been done to get llvm to run on LiteBSD. Includes its own C++ compler, CPP, and assembler (which is built-in, llvm-as will be a standalone application in llvm-3.8.0), requires an external linker (caveat: lld can statically link mipsel binaries but do not know if it can do anything else), supports everything, BSD licensed. FreeBSD uses this as its system compiler, DragonFly will move to this as one of their 2 supported system compilers, NetBSD has considered moving, OpenBSD has considered moving. A potential system compiler if it can run on LiteBSD.
smlrc - Supports RetroBSD, could likely be re-targeted for LiteBSD. Needs the rest of the suite. Unknown if could be a system compiler (but seems like yes, due to it having that distinction for RetroBSD). Unlike all of the above, is not a C11 compiler (it is C89/C99, which is enough for LiteBSD) but might be able to bootstrap pcc or an earlier gcc.

Assembler:
GNU as - Up to version 2.11 works. 2.12 and above segfault on startup (unknown if memory exhaustion or they're being miscompiled). GNU as 2.11.2 is in the LiteBSD package repo.
Serge's as - A GNU as syntax assembler. As long as it can assemble everything pcc and gcc (and smlrc) give it, it would be a perfectly good system assembler. The -k flag (produce PIC code) is currently unsupported but should be considered a hard requirement.
Other assemblers - ???

Linker:
GNU ld - Up to version 2.10 works (as in, doesn't segfault) but doesn't successfully link anything. Version 2.12 and above, same as GNU as. If it is miscompilation that is causing the problems, the problems are likely in libiberty or libbfd and affecting both programs.
LLVM lld - Likely able to link static binaries if it can run on LiteBSD
ELFtoolchain ld - Runs, fails to link anything (see my post on the forums).

Error running LiteBSD in QEMU

The sd card build went smoothly, but when running on qemu with the following command:

/usr/local/qemu-mips/bin/qemu-system-mipsel -machine pic32mz-wifire -nographic -monitor none -serial vc -serial vc -serial vc -serial stdio -bios boot-wifire.hex -kernel sys/compile/WIFIRE.pic32/vmunix.hex -sd sdcard.img

I get this:

Processor: microAptivP
RAM size: 512 kbytes
Load file: 'boot-wifire.hex', 6916 bytes
Load file: 'sys/compile/WIFIRE.pic32/vmunix.hex', 545888 bytes
Card0 image 'sdcard.img', 204801 kbytes
Copyright (c) 1982, 1986, 1989, 1991, 1993
	The Regents of the University of California.  All rights reserved.

4.4BSD-Lite build 0 compiled 2022-03-19
    xxxUbuntu:LiteBSD/sys/compile/WIFIRE.pic32
cpu: PIC32MZ2048ECG100 rev A4, 200 MHz
oscillator: system PLL div 1:6 mult x50
real mem = 512 kbytes
avail mem = 340 kbytes
using 18 buffers containing 73728 bytes of memory
spi1 at pins sdi=RF1/sdo=RC1/sck=RD1
spi2 at pins sdi=RF0/sdo=RD11/sck=RG6
spi3 at pins sdi=RB10/sdo=RC4/sck=RB14
spi4 at pins sdi=RF5/sdo=RG0/sck=RD10
uart1 at pins rx=RD14/tx=RD15, interrupts 112/113/114
uart4 at pins rx=RF2/tx=RF8, interrupts 170/171/172, console
sd0 at port spi3, pin cs=RC3
gpio0 at portA, pins -i---ii-iiiiiiii
gpio1 at portB, pins i---i-iiiiiiiiii
gpio2 at portC, pins iiii---------i--
gpio3 at portD, pins --ii------iiii-i
gpio4 at portE, pins ------iiiiiiiiii
gpio5 at portF, pins --ii--------i---
gpio6 at portG, pins oiii--iii-------
mrf0 not found at port spi4, pin cs=RD9
sd0: type I, size 204800 kbytes, speed 12 Mbit/sec
sd0a: partition type b7, sector 2, size 204800 kbytes
sd0b: partition type b8, sector 409602, size 32768 kbytes
sd0c: partition type b7, sector 475138, size 102400 kbytes
bpf: sl0 attached
bpf: lo0 attached
WARNING: preposterous clock chip time -- CHECK AND RESET THE DATE!
init: not found
panic: no init
syncing disks... done

dumping to dev 2, offset 64512
dump device bad

Possible shadow declarations in <ctype.h>

pcc has explicit -Werror -Wshadow CPPFLAGS.
It found this:

/home/retrobsd/litebsd/DESTDIR/usr/include/ctype.h:123:1: error: declaration of 'toupper' shadows a built-in function [-Werror=shadow]
 toupper(_BSD_RUNE_T_ c)
 ^
/home/retrobsd/litebsd/DESTDIR/usr/include/ctype.h:130:1: error: declaration of 'tolower' shadows a built-in function [-Werror=shadow]
 tolower(_BSD_RUNE_T_ c)
 ^

C Compiler Problem

Has anyone been able to build using cc and then run an executable from within LiteBSD?

/* Hello world program, hello.c. */
#include <stdio.h>
main()
{
printf("hello world\n");
}

Compiling "hello.c" gives the following linker editor error.
$ cc hello.c
ld: multiple definition of symbol __divdi3
error: ld terminated with status 1

/* Null program, null.c. */
main()
{
}

Compiling "null.c" gives no compile/linker error, but causes a memory runtime error.
$ cc null.c
$ ./a.out
sh: ./a.out: Cannot allocate memory

Any ideas?

`su` causes the process to hang

Running su hangs the foreground process. The terminal is still responsive (it echoes), but you can't do anything.

The same happens if you try telnetting in to a telnetd that's spawned from inetd.

/sbin/init doesn't respond to SIGHUP

A SIGHUP sent to the /sbin/init process is supposed to re-read /etc/ttys and start/stop any gettys that need it.

It doesn't do anything at the moment by the looks of things - you have to reboot in order to register changes to /etc/ttys

Ethernet driver: get rid of TX buffer

Remote TX buffer: use data directly from transmit mbuf chain. It will reduce the memory footprint by 2kbytes. Need to increase the number of TX descriptors to some reasonable value, say 16.

Majenko SDZL board equivalent

Unfortunately the Majenko SDZL board (so far) is not available, either as a design or a premade board. So I am designing an equivalent SDZL board, with the intention that it will work with the pre built SDZL binaries.
Like the SDZL board this board will be based around the 64pin PIC32MZ2048ECM064, and expected to support the same peripherals, and so have the same assigned microcontroller pins. The SDZL wiki offers most config and hardware information, as does the LiteBSD startup screen.

Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.

    4.4BSD-Lite build 1 compiled 2015-08-27
        sergev@ubuntu-sergev:LiteBSD/sys/compile/Whitecat.pic32
    cpu: PIC32MZ2048ECM064 rev A5, 200 MHz
    oscillator: system PLL div 1:6 mult x50
    cache: 16/4 kbytes
    real mem = 512 kbytes
    avail mem = 344 kbytes
    using 18 buffers containing 73728 bytes of memory
    spi2 at pins sdi=G7/sdo=G8/sck=G6
    en0 at interrupt 153, MAC address d8:80:39:13:d3:67
    en0: <SMSC LAN8720A> at address 1
    uart1 at pins rx=F4/tx=F5, interrupts 112/113/114, console
    uart2 at pins rx=B7/tx=B6, interrupts 145/146/147
    uart3 at pins rx=C13/tx=C14, interrupts 157/158/159
    uart4 at pins rx=D5/tx=D4, interrupts 170/171/172
    sd0 at port spi2, pin cs=G9
    gpio1 at portB, pins ------------iiii
    sd0: type II, size 1982464 kbytes, speed 16 Mbit/sec
    sd0a: partition type b7, sector 2, size 204800 kbytes
    sd0b: partition type b8, sector 409602, size 32768 kbytes
    sd0c: partition type b7, sector 475138, size 102400 kbytes
    WARNING: preposterous clock chip time -- CHECK AND RESET THE DATE!

But there are some questions that need clarifying, which hopefully someone can answer.

  1. PLL div 1:6 is printed out on the startup screen, so I assume the microcontroller uses a 8MHz crystal?

  2. Unlike the SDZL board, this board will obviously not have a bootloader. So I intend to program the microcontroller directly using the ICSP with one of the Microchip programming tools (e.g. Pickit3 or ICD3) and the vmunix.hex firmware. Will this method work?

  3. I was expecting to find the microcontroller routines amongst the ported source code on the github repository, but I couldn't find any microcontroller specific code. If it is somewhere there, where should I look?

Thanks in advance.
BTW what an interesting project, and I tip my hat to Serge for his great work!

New more(1) bug

The new more(1) gives wrong percentages on the bottom of the screen.
When you first load it up, it correctly shows 0% but when I press Enter to go down one line, it goes up to 300%, then 1700%, then 3400%, then down to 700%.
Tested with the new bc(1) man page.

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.