# Ljinux
A "linux" written in python, for CircuitPython powered microcontrollers.<br />
[![build](https://github.com/bill88t/ljinux/actions/workflows/Compiletest.yml/badge.svg)](https://github.com/bill88t/ljinux/actions/workflows/Compiletest.yml)
[![Black Formatting](https://github.com/bill88t/ljinux/actions/workflows/black.yml/badge.svg)](https://github.com/bill88t/ljinux/actions/workflows/black.yml)
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
<br />
Important notes:<br />
Do not take this project seriously.<br />
This is not a real os / linux distribution, but here we are.<br />
Also, it's still in an alpha state.<br /><br />
<b><i>We also now have a [discord](https://discord.gg/V8AejwGpCv) server!<br />
If you need support or want to hang out, feel free to join in!</i></b><br /><br />
Anyways, since you are still reading...<br />
Table of Contents
=================
* [Prerequisites](#prerequisites-and-optional-hardware)<br />
* [Installation / updating](#installation--updating)
* [Configuration](#configuration)
* [Connection](#connection)
* [Directory structure](#directory-structure)
* [Contributors](#contributors)
* [Manual](#a-complete-ljinux-manual-is-available)
* [Useful resources](#useful-resources-that-helped-with-the-development-of-this-project)
<br />
## Prerequisites and optional hardware
Depends on circuitpython 7. (Supported 7.0.0 - 7.3.0)<br />
At the moment the supported microcontrollers are:<br /><br />
- Raspberry Pi Pico<br />
- Raspberry Pi Pico W <br />
<sub><sup>At the moment no CircuitPython uf2 image exists
is instead relies on the normal Pico's uf2.
This results to some bugs, the led & wifi don't work.<br />
- Waveshare RP2040-Zero <br />
But it can probably run on many more.<br />
The only real limiting factor should be ram, as about 120k are needed for the system to even function.<br />
<i>(If you have gotten it running on an unsupported board, feel free to pr a configuration file)</i><br />
<br />Optional hardware compatible with ljinux:<br />
- SSD1306 displays for a standalone display output<br />
- ds1302 realtime clocks for persistent time (make sure to set <code>fixrtc</code> to false from the board's config file)<br />
- sdcard breakout boards for more storage<br />
- w5500 networking breakouts board for networking.<br />
For the missing hardware the functions will be automatically deactivated. (The hardware will also be deactivated in case of missing libraries.)<br />
It expects to find a <code>/LjinuxRoot</code> folder which uses as it's root. It can be on the built in fs, or an sd card.<br />
More info in Configuration.<br />
Ljinux's shell is named <b>based</b> and is equivelant to gnu bash.<br />
Python commands can also be used with the pexec command.<br />
Whole .py files can be run with the use of the fpexec command.<br />
They all run in the same scope as ljinux for ease of use. Security is not a priority on a microcontroller. Especially at the cost of ram.<br />
You can connect to it over usb serial, or by providing startup commands via a <code>Init.lja</code> file.<br />
The <code>Init.lja</code> has to be at <code>/LjinuxRoot/boot/</code> of the board's internal storage or on the <code>/boot/</code> of the attached sd card.<br />
It has it's own curses library, jcurses.<br />
And it's own display "compositor", farland.<br /><br />
## Installation / Updating
<i>Note: Automatic Windows install not supported at the moment. Linux & MacOS only.</i><br /><br />
1) Install a supported CircuitPython version onto the board<br />
Raspberry Pi Pico uf2 file can be found [here](https://circuitpython.org/board/raspberry_pi_board) & detailed instructions regarding CircuitPython can be found [here](https://learn.adafruit.com/welcome-to-circuitpython).<br />
2) Clone (or download this repository) and from within the "source" folder, run <code>make install</code>.<br />
This command will automatically update the system files if they already exist.<br />
To only update the wanna-be kernel run <code>make</code> instead.<br />
(For these commands to work you need to have python3 installed, and the board attached & mounted.)<br />
3) *(Optional)* Install the optional libraries for the hardware you want to connect to it.<br />
<b>If you plan on using the board standalone, you don't need put any extra libraries in.</b><br />
4) After these steps, eject the board and fully disconnect it from the pc. (It is important to power cycle it.)<br />
When it's plugged back in, it should run automatically and you can connect to it via serial. (You can use putty on windows, or gnu/screen on gnu/linux)<br />
An automated connection script exists in the form of <code>make connection</code><br />
<b>IMPORTANT NOTE: To make the pi appear as a usb device on the host, run the ljinux command </b><code>devmode</code><br />
<br />
## Configuration
<i>Each board has it's own different pin configuration. You can see the defaults and modify them from the board's respecive config file.</i><br /><br />
<b>Libraries needed for optional hardware:</b><br />
For the SSD1306 display: <code>adafruit_ssd1306 adafruit_framebuf</code><br />
Sdcard: <code>adafruit_sdcard adafruit_bus_device</code><br />
The sdcard has to be formatted as Fat32 / Fat16 or equivelant.<br />
Ethernet: <code>adafruit_wiznet5k adafruit_wsgi adafruit_requests adafruit_bus_device</code><br /><br />
The neccessary libraries can be found [here](https://github.com/adafruit/Adafruit_CircuitPython_Bundle/releases)<br />
Download the zip (The 7.x-mpy variant), extract it & copy the libraries you want onto <code>/lib</code> of the board.<br /><br />
## Connection
For an automated way on Linux/MacOS, run <code>make connection</code>. Manual way below.<br /><br />
To connect to the board it's recommended to use Putty for Windows and GNU/Screen for Linux/MacOS.<br />
For Putty, select connection type to be Serial, select the port to be COM<b>X</b> where <b>X</b> is the number of the serial port allocated by the board and set the speed/baudrate to 115200. (You can find which com port is allocated from within the Device Manager, it usually is COM3 or COM4)<br /><br />
For GNU/Screen, if you are on linux, you need to be in the <code>dialout</code> user group and to connect, run: <code>screen /dev/ttyACM0 115200</code><br />If you are on a Mac instead, run: <code>ls /dev/tty.usb*</code> to find the device name, and connect to it by running: <code>screen /dev/tty.usb\<Device name here\> 115200</code><br />
Example: <code>screen /dev/tty.usbmodem12210 115200</code><br /><br />
To disconnect, press Ctrl + A, K and confirm with y.<br />
To be added to the <code>dialout</code> group, run <code>sudo usermod -a -G dialout \<your username here\></code><br /><br />
## Directory structure
<ul>
<li><code>LjinuxRoot</code>, the root filesystem for ljinux. It should be copied as is to the board.</li>
<li><code>rootfilesystem</code>, the files needed in the root of the board. These should also be copied as is.</li>
<li><code>scripts</code>, the files needed for compilation, and installation to a board. They should not be copied over,</li>
<li><code>source</code>, the source files for ljinux and co. They should be compiled into .mpy files and put in /lib of the board.</li>
</ul>
<br />
## Contributors
-> [bill88t](https://github.com/bill88t) - @bill88t#4044
<br />-> [Marios](https://github.com/mariospapaz) - @mariospapaz#2188
<br />-> [mdaadoun](https://github.com/mdaadoun) - @mdaadoun#4475
<br />
## A complete Ljinux manual is available
https://github.com/bill88t/ljinux/blob/main/Manual.txt<br />
<br />
## Useful resources that helped with the development of this project
https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797<br />
https://en.wikipedia.org/wiki/ANSI_escape_code<br />
https://github.com/todbot/circuitpython-tricks<br
没有合适的资源?快使用搜索试试~ 我知道了~
python中的“linux”,用于CircuitPython微控制器_C语言_代码_相关文件_下载
共197个文件
py:61个
lja:52个
json:34个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 148 浏览量
2022-07-07
03:26:49
上传
评论
收藏 2.59MB ZIP 举报
温馨提示
一个用 python 编写的“linux”,用于 CircuitPython 驱动的微控制器。 目录 先决条件 安装/更新 配置 联系 目录结构 贡献者 手动的 有用的资源 先决条件和可选硬件 取决于 circuitpython 7。(支持 7.0.0 - 7.3.0) 目前支持的微控制器是: 树莓派 Pico Raspberry Pi Pico W 目前不存在 CircuitPython uf2 映像,而是依赖于普通 Pico 的 uf2。这会导致一些错误,导致 LED 和 wifi 无法正常工作。 Waveshare RP2040-零 但它可能可以运行更多。 唯一真正的限制因素应该是 ram,因为系统需要大约 120k 才能正常运行。 (如果你让它在不受支持的板上运行,请随时 pr 配置文件) 与 ljinux 兼容的可选硬件: 用于独立显示输出的 SSD1306 显示器 ds1302 实时时钟用于持续时间(确保fixrtc从板的配置文件中设置为 false) 用于更多存储的 SD 卡分线板 更多详情、使用方法,请下载后阅读README.md文件
资源推荐
资源详情
资源评论
收起资源包目录
python中的“linux”,用于CircuitPython微控制器_C语言_代码_相关文件_下载
(197个子文件)
.basedrc 14B
font5x8.bin 1KB
crontab 2B
mpy-cross-windows.exe 918KB
.gitkeep 0B
.gitkeep 0B
.gitkeep 0B
.gitkeep 0B
.gitkeep 0B
.gitkeep 0B
.gitkeep 0B
.gitkeep 0B
.gitkeep 0B
.gitkeep 0B
.gitkeep 0B
.gitkeep 0B
.gitkeep 0B
.history 0B
hostname 5B
default.html 738B
404.html 263B
config-raspberry_pi_pico.json 964B
config-waveshare_rp2040_zero.json 963B
display.json 351B
head.json 312B
tail.json 310B
webserver.json 217B
var.json 210B
fexec.json 184B
devmode.json 179B
pexec.json 179B
reboot.json 173B
time.json 148B
exec.json 143B
help.json 138B
man.json 132B
exit.json 128B
su.json 127B
ls.json 127B
whois.json 121B
uname.json 120B
echo.json 120B
goto.json 115B
history.json 110B
sensors.json 110B
pwd.json 107B
cd.json 101B
cat.json 100B
mkdir.json 97B
neofetch.json 96B
pinout.json 96B
rmdir.json 95B
dmesg.json 92B
rm.json 85B
wait.json 83B
LICENSE 34KB
_rebootprompt.lja 266B
testargj.lja 251B
sensors.lja 234B
Init.lja 158B
_waitforserial.lja 126B
jct.lja 117B
pwd.lja 109B
neofetch.lja 90B
halt.lja 69B
devmode.lja 56B
dir.lja 52B
exit.lja 46B
reboot.lja 46B
cd.lja 46B
cat.lja 45B
playwav.lja 45B
clear.lja 43B
playmp3.lja 41B
man.lja 40B
uname.lja 40B
ls.lja 38B
touch.lja 36B
whois.lja 36B
sleep.lja 33B
sha224sum.lja 28B
sha512sum.lja 28B
tail.lja 28B
sha384sum.lja 28B
sha256sum.lja 28B
detect.lja 28B
timedate.lja 27B
head.lja 27B
display.lja 26B
sha1sum.lja 26B
unalias.lja 26B
ledset.lja 25B
md5sum.lja 25B
pinout.lja 25B
random.lja 25B
dmesg.lja 24B
mkdir.lja 24B
crc32.lja 24B
alias.lja 24B
rmdir.lja 24B
共 197 条
- 1
- 2
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功