Giter Club home page Giter Club logo

ewokos's Introduction

EwokOS

.Author

.About

A microkernel OS for learning operating system. versatilepb / raspi1,2,3 ported well, raspi4 todo....
-mmu
-smp multi-core
-copy on write
-multi processes
-multi thread
-ipc
-virtual fs service(everythig is a file)
-very simple ramdisk for initrd
-framebuffer device service for graphics
-uart device service
-SD card

.Environment & Tools

QEMU: 
	modified qemu file: hw/sd/sd.c and recompile
	......
	if(req.arg & ACMD41_ENQUIRY_MASK) { //modified by Misa.Z 
	/*if (FIELD_EX32(sd->ocr & req.arg, OCR, VDD_VOLTAGE_WINDOW)) {*/
		/* We accept any voltage.  10000 V is nothing.
		*
		* Once we're powered up, we advance straight to ready state
		* unless it's an enquiry ACMD41 (bits 23:0 == 0).
		*/
		sd->state = sd_ready_state;
	}
	......

risc-v toolchains:
	https://github.com/riscv-software-src/homebrew-riscv

Mac OSX(with brew installed):	
	brew tap PX4/homebrew-px4
	brew install gcc-arm-none-eabi-49
	brew install e2tools
	(set the right PATH environment after installed)
	download usb to ttl driver https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers
	
How to create/mount ext2 image in macosx
	===============prepair================
	install macFUSE from official website(https://osxfuse.github.io/)
	brew install e2fsprogs
	brew install libtool 
	brew install autoconf
	brew install automake

	(download https://github.com/alperakcan/fuse-ext2)
	./autogen.sh
	CFLAGS="-idirafter/opt/gnu/include -idirafter/usr/local/include/osxfuse/ -idirafter/$(brew --prefix e2fsprogs)/include" LDFLAGS="-L/usr/local/opt/glib -L/usr/local/lib -L$(brew --prefix e2fsprogs)/lib" ./configure
	sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
	make
	sudo make install
	=================example==============
	dd if=/dev/zero of=root.ext2 bs=1024 count=16384
	mke2fs -b 1024 -I 128 root.ext2 (make ext2 fs with: block_size=1024 inode_size=128)
	mkdir -p tmp
	fuse-ext2 -o force,rw+ img tmp
	(copy files)
	umount ./tmp
	rm -r tmp

.tty debug

install minicom(linux/mac)

.make

"cd kernel/build/{arch}; make":
  build EwokOS kernel image.

.make rootfs (system/root.ext2)

"cd system; make/make full(with xgui)/make extra(with xgui and extra apps"; make sd:
  build EwokOS rootfs apps and sd file system.

.run by qemu (raspi2)

"cd kernel/build/raspi/pi2.3"
"make run":
  run EwokOS(username: root, password: (none));
"make debug":
  run EwokOS at debug server-mode.
"make gdb":
  debug EwokOS (debug client-mode).

.xmake build system

"xmake":
    build kernel && system

"xmake b xxx":
    only build package xxx
    package list:
       kernel
       system
       rootfs
       ...

"xmake f -p xxx"
    switch platform to "xxx", defalut is miyoo
    platform list:
        miyoo
        raspi1
        raspi2.3
        raspi4
        
  "xmake c"
     clean project

  "xmake run qemu"
     run ewokos in qemu
     
  "xmake show"
     show current project infomation      

.commands

Most of commands are in 'rootfs/sbin' directory, like:
ls, ps, pwd, test ......

.Source code read-guide Tips: Don't fall in love with assembly too much;).

ewokos's People

Contributors

bangsan333 avatar evilbinary avatar misazhu avatar smwikipedia avatar tonytsangzen avatar zetalog 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

ewokos's Issues

The latest code can't build pass

Error:
~/Documents/Git/EwokOS/system   master  make
cd basic;make
cd ./libs/libc;make
arm-none-eabi-gcc -Wstrict-prototypes -marm -pedantic -Wall -Wextra -msoft-float -fPIC -mapcs-frame -fno-builtin-printf -fno-builtin-memset -fno-builtin-snprintf -fno-builtin-sprintf -fno-builtin-fprintf -Wno-overlength-strings -fno-builtin-exit -fno-builtin-stdio -std=c99 -O2 -I ../../../build/include -Iinclude -Isys/include -c -o sys/src/vfs.o sys/src/vfs.c
sys/src/vfs.c:386:5: error: conflicting types for 'vfs_create'
int vfs_create(const char* fname, fsinfo_t* ret, int type, bool vfs_node_only) {
^
In file included from sys/src/vfs.c:1:0:
../../../build/include/sys/vfs.h:35:11: note: previous declaration of 'vfs_create' was here
int vfs_create(const char* fname, fsinfo_t* ret, int type);
^
make[2]: *** [sys/src/vfs.o] Error 1
make[1]: *** [basic_libs] Error 2
make: *** [basic_sys] Error 2

How build Lua into EwokOS?

I try to build Lua (version 5.4.1) into EwokOS, it fail. The errors:

arm-none-eabi-gcc -marm -pedantic -Wall -Wextra -msoft-float -fPIC -mapcs-frame -DLUA_32BITS -fno-builtin-printf -fno-builtin-memset -fno-builtin-snprintf -fno-builtin-sprintf -fno-builtin-fprintf -Wno-overlength-strings -fno-builtin-exit -fno-builtin-stdio -fno-exceptions -O2 -c -o ltablib.o ltablib.c
arm-none-eabi-gcc -marm -pedantic -Wall -Wextra -msoft-float -fPIC -mapcs-frame -DLUA_32BITS -fno-builtin-printf -fno-builtin-memset -fno-builtin-snprintf -fno-builtin-sprintf -fno-builtin-fprintf -Wno-overlength-strings -fno-builtin-exit -fno-builtin-stdio -fno-exceptions -O2 -c -o lutf8lib.o lutf8lib.c
arm-none-eabi-gcc -marm -pedantic -Wall -Wextra -msoft-float -fPIC -mapcs-frame -DLUA_32BITS -fno-builtin-printf -fno-builtin-memset -fno-builtin-snprintf -fno-builtin-sprintf -fno-builtin-fprintf -Wno-overlength-strings -fno-builtin-exit -fno-builtin-stdio -fno-exceptions -O2 -c -o linit.o linit.c
arm-none-eabi-ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
arm-none-eabi-ranlib liblua.a
arm-none-eabi-gcc -marm -pedantic -Wall -Wextra -msoft-float -fPIC -mapcs-frame -DLUA_32BITS -fno-builtin-printf -fno-builtin-memset -fno-builtin-snprintf -fno-builtin-sprintf -fno-builtin-fprintf -Wno-overlength-strings -fno-builtin-exit -fno-builtin-stdio -fno-exceptions -O2 -c -o lua.o lua.c
arm-none-eabi-gcc -o lua -L../../../build/lib -lnosys lua.o liblua.a -lm -Wl,-E -ldl -static
/usr/local/Cellar/gcc-arm-none-eabi-49/20150925/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: cannot find -ldl
collect2: error: ld returned 1 exit status
make[2]: *** [lua] Error 1
make[1]: *** [linux-noreadline] Error 2
make: *** [linux] Error 2


The Makefile I modified is

Makefile.rename.txt
src/Makefile.rename.txt


How do it right, pls give me some guideline.

Failed to build rootfs under Ubuntu 18.04

OS: Ubuntu 18.04 x86_64
Tool chain: sudo apt-get install qemu-system-arm gcc-arm-none-eabi

Steps:

  1. Clone latest code
  2. cd rootfs
  3. make
arm-none-eabi-gcc -I. -O2 -Wstrict-prototypes -I ../lib/include -I lib/include -I ../kernel/include -marm -pedantic -Wall -Wextra -msoft-float -fPIC -mapcs-frame -fno-builtin-printf -fno-builtin-strcpy -Wno-overlength-strings -fno-builtin-exit -fno-builtin-stdio -std=c99  -I dev/sramdisk -c -o dev/sramdisk/sramdisk.o dev/sramdisk/sramdisk.c
arm-none-eabi-ld -Ttext=100 dev/sramdisk/*.o lib/libewoklibc.a ../kernel/lib/kstring.o ../kernel/lib/basic_math.o ../kernel/lib/device.o ../kernel/lib/sconf_parse.o ../kernel/lib/trunk.o ../kernel/lib/tstr.o ../kernel/lib/vprintf.o ../kernel/arch/arm/common/memcpy.o -o build/sbin/dev/sramdisk 
dev/sramdisk/sramdisk.o: In function `sramdisk_open':
**sramdisk.c:(.text+0x268): undefined reference to `calloc'**
dev/sramdisk/build.mk:8: recipe for target 'build/sbin/dev/sramdisk' failed
make: *** [build/sbin/dev/sramdisk] Error 1

arm-none-eabi-objdump -D dev/sramdisk/sramdisk.o > sramdisk.o.objdump

145 00000208 <sramdisk_open>:
146  208:   e1a0c00d        mov     ip, sp
147  20c:   e92dd830        push    {r4, r5, fp, ip, lr, pc}
148  210:   e24cb004        sub     fp, ip, #4
149  214:   e24dd020        sub     sp, sp, #32
150  218:   e24b4034        sub     r4, fp, #52     ; 0x34
151  21c:   e1a02001        mov     r2, r1
152  220:   e1a01000        mov     r1, r0
153  224:   e1a03004        mov     r3, r4
154  228:   e3a00026        mov     r0, #38 ; 0x26
155  22c:   ebfffffe        bl      0 <syscall3>
156  230:   e3500000        cmp     r0, #0
157  234:   1a000011        bne     280 <sramdisk_open+0x78>
158  238:   e51b3028        ldr     r3, [fp, #-40]  ; 0xffffffd8
159  23c:   e3530000        cmp     r3, #0
160  240:   01a00003        moveq   r0, r3
161  244:   0a000002        beq     254 <sramdisk_open+0x4c>
162  248:   e51b5018        ldr     r5, [fp, #-24]  ; 0xffffffe8
163  24c:   e3550000        cmp     r5, #0
164  250:   0a000002        beq     260 <sramdisk_open+0x58>
165  254:   e24bd014        sub     sp, fp, #20
166  258:   e89d6830        ldm     sp, {r4, r5, fp, sp, lr}
167  25c:   e12fff1e        bx      lr
168  260:   e3a01001        mov     r1, #1
169  264:   e3a0000c        mov     r0, #12
**170  268:   ebfffffe        bl      0 <calloc>**
171  26c:   e50b0018        str     r0, [fp, #-24]  ; 0xffffffe8
172  270:   e1a00004        mov     r0, r4
173  274:   ebfffffe        bl      0 <fs_update>
174  278:   e1a00005        mov     r0, r5
175  27c:   eafffff4        b       254 <sramdisk_open+0x4c>
176  280:   e3e00000        mvn     r0, #0
177  284:   eafffff2        b       254 <sramdisk_open+0x4c>

Checked arm-none-eabi-gcc -E, didn't find any clue.

I'm still trying to find out why the malloc() in the sramdisk_open() changed to calloc().

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.