Git Product home page Git Product logo

jameslinus / meshbsd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rubo77/meshbsd

0.0 3.0 0.0 216.97 MB

Operating System based on FreeBSD for Embedded Systems and Mobile Stations (under-construction) .

License: Other

Shell 0.72% Makefile 1.48% C 56.55% Groff 5.06% Yacc 0.29% C++ 34.63% Max 0.01% Perl 0.09% Objective-C 0.44% Protocol Buffer 0.01% Ruby 0.01% Logos 0.05% Assembly 0.46% Lex 0.04% DTrace 0.01% Python 0.02% Awk 0.07% Forth 0.06% PHP 0.01% Mathematica 0.01%

meshbsd's Introduction

MeshBSD (under construction)

After I've read


  https://www.kernel.org/doc/Documentation/stable_api_nonsense.txt

I was disgusted and I've decided to build an operating system for embedded systems and mobile station based on FreeBSD operating system and components adopted and ported from OpenBSD and NetBSD.


    This project is at an early stage!

This operation is divided into three major stages:


 #1 Buildup of code-base as free generating set for base operating system.

 #2 Divide set of given Makefiles and transition into a set of modularized
    components acting as toolkit for generating an operating system targeting  
    embedded systems and mobile stations.
    
 #3 Generate an developement environment for building aplications as
    subset on e. g. X.org based GUI.

Well, there are some pending operational tasks


 #1 Integration of OpenSMTPd(8) as replacement for 
    sendmail(8), but I'll not integrate the portable
    version, because of some dependencies (!) like:

     * autoconf (http://www.gnu.org/software/autoconf/)
     * automake (http://www.gnu.org/software/automake/)
     * bison (http://www.gnu.org/software/bison/)
       or byacc (http://invisible-island.net/byacc/byacc.html)
     * libtool (http://www.gnu.org/software/libtool/)
     * openssl (http://www.openssl.org/)
     * ...

    are still increasing the complexity.
 
 #2 Porting if_pppoe(4) from NetBSD for kernel ppp(4).

 #3 Integration of common or generic llc(4) domain
    on top of Ethernet MAC layer. 

whom I am working on it.

Flattr this git repo Please feel free to support me anytime.

TL-WR1043NDv2 (experimental)

Now, there exists an experimental firmware image


   MeshBSD.tl-wr1043ndv2.201601291719.factory.bin

in releases directory (only) for demonstration purposes. Intentionally, this software is not released for use as production system or in context of production systems, because this software is not error-free.


   THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
   WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
   MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
   ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Basic requirements for installation of (experimental) firmware image are:


 * Soldered header on-board, which is used for serial 
   access through interconnected usb cable. 
   
    +-----+-----+-----+-----+
    | VCC | GND | RX  | TX  |
    +-----+-----+-----+-----+
     3.3V

 * Configured tftpd(8) daemon.
 
 * At least cu(1) -- Call Unix.

On host running FreeBSD, access to serial console might be performed e. g. through use of priveleged terminal:

 
  # cu -l /dev/ttyU0 -s 115200

Then, appliance (or router board) shall be switched on.


  
  U-Boot 1.1.4 (Jun 13 2014 - 15:14:01)
  
  ap135 - Scorpion 1.0DRAM:  
  sri
  Scorpion 1.0
  ath_ddr_initial_config(178): (16bit) ddr2 init
  tap = 0x00000003
  Tap (low, high) = (0x0, 0x1c)
  Tap values = (0xe, 0xe, 0xe, 0xe)
  64 MB
  Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x17
  flash size 8MB, sector count = 128
  Flash:  8 MB
  Using default environment
  
  *** Warning *** : PCIe WLAN Module not found !!!
  *** Warning *** : PCIe WLAN Module not found !!!
  In:    serial
  Out:   serial
  Err:   serial
  Net:   ath_gmac_enet_initialize...
  athrs_sgmii_res_cal: cal value = 0x6
  No valid address in Flash. Using fixed address
  No valid address in Flash. Using fixed address
  ath_gmac_enet_initialize: reset mask:c02200 
  Scorpion  ----> S17 PHY *
  athrs17_reg_init: complete
  : cfg1 0x80000000 cfg2 0x7114
  eth0: ba:be:fa:ce:08:41
  eth0 up
  athrs17_reg_init_wan done
  SGMII in forced mode
  athr_gmac_sgmii_setup SGMII done
  : cfg1 0x800c0000 cfg2 0x7214
  eth1: ba:be:fa:ce:08:41
  eth1 up
  eth0, eth1
  Setting 0x18116290 to 0x58b1a14f
  Autobooting in 1 seconds

The booting procedure may interrupted by entering

 
   tpl

within time intervall, shown as above. Then


  ap135>

occours as prompt on screen, awaiting input.


  ap135> printenv 

shows environment for bootstrapping an operating system.


  bootargs=console=ttyS0,115200 root=31:02 rootfstype=jffs2 init=/sbin/init mtdparts=ath-nor0:256k(u-boot),64k(u-boot-env),6336k(rootfs),1408k(uImage),64k(mib0),64k(ART)
  bootcmd=bootm 0x9f020000
  bootdelay=1
  baudrate=115200
  ethaddr=0xba:0xbe:0xfa:0xce:0x08:0x41
  ipaddr=192.168.1.111
  serverip=192.168.1.100
  dir=
  lu=tftp 0x80060000 ${dir}u-boot.bin&&erase 0x9f000000 +$filesize&&cp.b $fileaddr 0x9f000000 $filesize
  lf=tftp 0x80060000 ${dir}ap135${bc}-jffs2&&erase 0x9f050000 +0x630000&&cp.b $fileaddr 0x9f050000 $filesize
  lk=tftp 0x80060000 ${dir}vmlinux${bc}.lzma.uImage&&erase 0x9f680000 +$filesize&&cp.b $fileaddr 0x9f680000 $filesize
  stdin=serial
  stdout=serial
  stderr=serial
  ethact=eth0
 
  Environment size: 686/65532 bytes

It is obvious that host might be configured by


  # ifconfig re0 inet 192.168.1.100/24 up 
  # route add -4 192.168.1.111 192.168.1.100
  add host 192.168.1.111: gateway 192.168.1.100

in conjuction with


  # cat >> /etc/inetd.conf << EOF
  > tftp dgram udp wait root /usr/libexec/tftpd tftpd -l -s /tftpboot
  > EOF

then


  # service inetd {one}{re}start

initializes tftpd(8) daemon manually.


  ap135> tftpboot 0x80060000 MeshBSD.tl-wr1043ndv2.201601291719.factory.bin

loads


  dup 1 speed 1000
  Using eth1 device
  TFTP from server 192.168.1.100; our IP address is 192.168.1.111
  Filename 'MeshBSD.tl-wr1043ndv2.201601291719.factory.bin'.
  Load address: 0x80060000
  Loading: #################################################################
           #################################################################
           #################################################################
           #################################################################
           #################################################################
           #################################################################
           #################################################################
           #################################################################
           #################################################################
           #################################################################
           #################################################################
           #################################################################
           #################################################################
           #################################################################
           #################################################################
           #################################################################
           #################################################################
           #################################################################
           #################################################################
           #########
  done
  Bytes transferred = 6368768 (612e00 hex)

the (experimental) firmware image into random access memory starting at address 0x80060000 on (this) ap135 (router) board.


  ap135> erase 0x9f020000 +0x7c0000
  Erasing flash... 

erases contents of flash memory at 0x9f020000 through 0x7c0000 bytes offset:


  First 0x2 last 0x7d sector size 0x10000
  125
  Erased 124 sectors  

The flash memory is now ready for copying in the firmware


  ap135> cp.b 0x80060000 0x9f020000 0x7c0000
  Copy to Flash... write addr: 9f020000
  done 

then


  ap135> bootm 0x9f020000

starts bootstrapping.

 
  ## Booting image at 9f020000 ...
     Uncompressing Kernel Image ... OK
 
  Starting kernel ...

When operating system kernel and init(8) process are running, then


  FreeBSD/mips (styx.testenv.local) (ttyu0)
 
  login: 

shall occour as login prompt on serial console. After logging in


  login: root

by use of an empty password. It will be changed by

 
  # passwd root
  Changing local password for user
  New Password:
  Retype New Password:

then


  # ifconfig

provides a listing


  arge0: flags=8843 metric 0 mtu 1500
         options=8
         ether c4:6e:1f:b9:19:e1
         media: Ethernet 1000baseT 
         status: active
  arge1: flags=8843 metric 0 mtu 1492
         options=8
         ether c4:6e:1f:b9:19:e2
         inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255 
         media: Ethernet 1000baseT 
         status: active
  lo0: flags=8049 metric 0 mtu 16384
         options=600003
         inet 127.0.0.1 netmask 0xff000000 
         groups: lo 

about configured network interfaces on link-layer. Any persistent configuration on network interfaces shall described by

 
    /etc/hostname.if

configuration file. Its contents provides either by dhclient(8) or ifconfig(8) accepted argument-vector for processing during execution of /etc/rc2, if and only if interface category was enlisted by


    network_interface_types="arge"

variable in


    /etc/rc.conf

configuration file. Implecitely,


  # cat >> /etc/hostname.wlan0 << EOF
  > create wlandev ath0 wlanmode adhoc
  > inet 192.168.2.1 netmask 255.255.255.0 ssid tiamat
  > mtu 1492
  > up
  > EOF 

in conjunction with


    network_interface_types="arge wlan"

creates an instance of wlan(4) device automatically. Therefore


  # cfg_save 

stores any in


    /etc/cfg/manifest 

enlisted and e. g. by


  # cat >> /etc/cfg/manifest << EOF
  > etc/hostname.wlan0
  > EOF

additionally promoted

 
  *** Storing configuration files from /etc/cfg/manifest -> /dev/map/cfg..
  etc/cfg/manifest
  etc/ppp/ppp.conf
  etc/dhcpd.conf
  etc/group
  etc/hostapd.conf
  etc/hostname.arge0
  etc/hostname.arge1
  etc/ipsec.conf
  etc/login.conf
  etc/master.passwd
  etc/myname
  etc/nsswitch.conf
  etc/ntp.conf
  etc/passwd
  etc/pf.conf
  etc/rc.conf
  etc/services
  etc/ttys
  etc/wpa_supplicant.conf
  etc/hostname.wlan0
  36 blocks
  0+1 records in
  1+0 records out
  65536 bytes transferred in 0.497583 secs (131709 bytes/sec)
  *** Completed.

configuration file as compressed image into NVRAM. When


  # reboot

takes place then


  # ifconfig

shows


  arge0: flags=8843 metric 0 mtu 1500
          options=8
          ether c4:6e:1f:b9:19:e1
          media: Ethernet 1000baseT 
          status: active
  arge1: flags=8843 metric 0 mtu 1492
          options=8
          ether c4:6e:1f:b9:19:e2
          inet 192.168.1.1 netmask 0xffffff00 broadcast 255.255.255.0 
          media: Ethernet 1000baseT 
          status: active
  lo0: flags=8049 metric 0 mtu 16384
          options=600003
          inet 127.0.0.1 netmask 0xff000000 
          groups: lo 
  wlan0: flags=8843 metric 0 mtu 1492
          ether c4:6e:1f:b9:19:e0
          inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255 
          media: IEEE 802.11 Wireless Ethernet autoselect mode 11ng 
          status: running
          ssid tiamat channel 10 (2457 MHz 11g ht/40-) bssid 86:18:5a:e0:41:d5
          country US ecm authmode OPEN privacy OFF txpower 27 scanvalid 60
          protmode CTS ampdulimit 8k ampdudensity 8 shortgi wme burst ff
          groups: wlan

enabled wlan(4) device. If e. g.


    arge0

may configured by DHCP, then


  # cat > /etc/hostname.arge0 << EOF
  > dhcp
  > EOF 

overwrites contents of interface-specific configuration file and enables DHCP.

Some additional information:


 * Easy editor ee(1) is useable for editing ascii encoded files.
 
 * It is possible to perform NAT by pf(4) in conjunction with ppp(8).

 * Handling of incoming PPPoE connections by pppoed(8) is possible.
 
 * Manually manipulation of SAD / SPD for ipsec(4) by setkey(8).  

 * Utilizing gif(4), if_vether(4) and wlan(4) in conjunction with 
   if_bridge(4) is possible, e. g. in context with rfc-3378.

 * Optional if_gre(4) and if_vlan(4) support.

Additional information about contacting

If someone wants to contact me by electronic mail, please use encryption.


-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2

mQENBFYMezIBCACo8X47yor6hI3Rwd2vYr+R2f35ZJw1Zq6qzQXYhWhn2CNf4gYJ
5+hEBi5LJcSFhSvujo/xy3OZzL8a4YN/vFWGTZhuyk20MOx96yjzLLbXD9lxHd+a
AoSPuPe78QSTAw7azv7PtUSTnH0KzLCC2Rh1yODYmU4bBw5Aeso/mmWNebh6hd7r
Azp3ruLji1YorWTUHWWDbq+EsB3bSvNq6hmGiOnTsWlhhdOre4ny0OD0Tig6OgFR
S3fkzofnroJN21MdAgofksaeClzdEgSDor1Yk/tcdCHRu4/kHEdEljD6YdpzWbKx
f6BsqMFLHKrksEF8H7oH+Cq3izXOeziy9TsVABEBAAG0Okhlbm5pbmcgTWF0eXNj
aG9rIDxoZW5uaW5nLm1hdHlzY2hva0BzdHVkLmZoLWZsZW5zYnVyZy5kZT6JATcE
EwEIACEFAlYMezICGwMFCwkIBwIGFQgJCgsCBBYCAwECHgECF4AACgkQzcSBpLKQ
n3Xocgf8Dcp8MoACABJbUDMHGzFOScLhSugj6zcWZVJ96Uyj1B4yrshk1GiSOid5
OkY+g0BLZDsZ6L/ikY55jh4FMRw6Ox6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support me anytime.

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.