Skip to content

Commit b8afb9b

Browse files
update linux and windows instructions
1 parent 07be0b1 commit b8afb9b

File tree

3 files changed

+65
-27
lines changed

3 files changed

+65
-27
lines changed
Lines changed: 52 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,82 @@
1-
# Building for Desktop
1+
# OS Development on Linux
22

3-
MicroPythonOS can be built to run as an application on Linux desktops (fully supported) or MacOS (untested).
3+
Most users can just use a pre-built binary from the [releases page](https://github.com/MicroPythonOS/MicroPythonOS/releases) and install it manually or using the [web installer](https://install.MicroPythonOS.com).
44

5-
## Prerequisites
5+
But if for some reason that one doesn't work, or you really want to modify things under the hood, you're in the right place here!
66

7-
<!-- https://github.com/lvgl-micropython/lvgl_micropython?tab=readme-ov-file#compiling-for-ubuntu-linux -->
7+
## Get the prerequisites
8+
9+
Clone the repositories:
10+
11+
```
12+
git clone --recurse-submodules https://github.com/MicroPythonOS/MicroPythonOS.git
13+
```
14+
15+
That will take a while, because it recursively clones MicroPython, LVGL, ESP-IDF and all their dependencies.
16+
17+
While that's going on, make sure you have everything installed to compile code:
818

9-
- Install dependencies (Linux):
1019
```
11-
sudo apt install libv4l-dev # For webcam support
20+
sudo apt update
21+
sudo apt-get install -y build-essential libffi-dev pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev libpipewire-0.3-dev libwayland-dev libdecor-0-dev libv4l-dev
1222
```
13-
- See [lvgl-micropython](https://github.com/MicroPythonOS/lvgl_micropython) for additional requirements.
14-
- Clone repositories as described in [Building for ESP32](esp32.md).
1523

16-
## Build Process
24+
## Compile the code
1725

18-
1. **Navigate to the Repository**:
26+
1. **Make sure you're in the main repository**:
1927

2028
```
21-
cd ~/MicroPythonOS/MicroPythonOS
29+
cd MicroPythonOS
2230
```
2331
24-
2. **Build for Linux**:
32+
2. **Start the Compilation**
33+
34+
Usage:
2535
2636
```
27-
./scripts/build_lvgl_micropython.sh unix dev
37+
./scripts/build_lvgl_micropython.sh <target system> <build type (prod or dev)> [optional target device]
2838
```
2939
30-
3. **Build for MacOS** (untested):
40+
Supported target systems: esp32, unix (= Linux) and macOS
41+
42+
Build types:
43+
- A "prod" build includes the complete filesystem that's "frozen" into the build, so it's fast and all ready to go but the files in /lib and /builtin will be read-only.
44+
- A "dev" build comes without a filesystem, so it's perfect for power users that want to work on MicroPythonOS internals. There's a simple script that will copy all the necessary files over later, and these will be writeable.
45+
Note: for unix and macOS systems, only "dev" has been tested. The "prod" builds might have issues.
46+
47+
Target devices: waveshare-esp32-s3-touch-lcd-2 and fri3d-2024
48+
49+
Examples:
3150
51+
<pre>
3252
```
33-
./scripts/build_lvgl_micropython.sh macOS dev
53+
./scripts/build_lvgl_micropython.sh esp32 prod fri3d-2024
54+
./scripts/build_lvgl_micropython.sh esp32 dev waveshare-esp32-s3-touch-lcd-2
55+
./scripts/build_lvgl_micropython.sh esp32 unix dev
56+
./scripts/build_lvgl_micropython.sh esp32 macOS dev
3457
```
58+
</pre>
59+
60+
The resulting build file will be in `lvgl_micropython/build/`, for example:
61+
- lvgl_micropython/build/lvgl_micropy_unix
62+
- lvgl_micropython/build/lvgl_micropy_macOS
63+
- lvgl_micropython/build/lvgl_micropy_ESP32_GENERIC_S3-SPIRAM_OCT-16.bin
3564
36-
## Running on Desktop
65+
## Running on Linux
3766
38-
1. Download a release (e.g., `MicroPythonOS_amd64_Linux`) or use your build.
67+
1. Download a release binary (e.g., `MicroPythonOS_amd64_Linux`) or use your own build from above.
3968
2. Run the application:
4069
4170
<pre>
4271
```
43-
cd internal_filesystem/
44-
/path/to/MicroPythonOS_amd64_Linux -X heapsize=32M -v -i -c "$(cat boot_unix.py main.py)"
72+
./scripts/run_desktop.sh
4573
```
4674
</pre>
4775
48-
3. Check `scripts/run_desktop.sh` for options like fullscreen or direct app launch.
76+
### Modifying files
77+
78+
You'll notice that, whenever you change a file on your local system, the changes are immediately visible whenever you reload the file.
4979
50-
## Notes
80+
This results in a very quick coding cycle.
5181
52-
- Linux is fully supported; MacOS support is experimental.
53-
- See [Supported Hardware](../getting-started/supported-hardware.md) for platform details.
82+
Give this a try by editing `internal_filesystem/builtin/apps/com.micropythonos.about/assets/about.py` and then restarting the "About" app. Powerful stuff!

docs/os-development/windows.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Building for Windows
2+
3+
As the main dependency ([lvgl_micropython](https://github.com/lvgl-micropython/lvgl_micropython), which bundles LVGL and MicroPython) doesn't support Windows, MicroPythonOS also doesn't support it.
4+
5+
But this is only necessary for OS development.
6+
7+
You can still participate in the bulk of the fun: creating cool apps!
8+
9+
To do so, install a pre-built firmware on a [supported device](../getting-started/supported-hardware.md) and then hopping over to [Creating Apps](../apps/creating-apps.md).

mkdocs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ nav:
4848
- System Components: architecture/system-components.md
4949
- Filesystem Layout: architecture/filesystem.md
5050
- OS Development:
51-
- Easy Quick Start: os-development/prebuilt.md
52-
- Building for Linux: os-development/building-for-linux.md
53-
- Building for MacOS: os-development/building-for-macos.md
54-
- Building for ESP32: os-development/building-for-esp32.md
51+
- On Linux: os-development/linux.md
52+
- On MacOS: os-development/macos.md
53+
- On Windows: os-development/windows.md
54+
- Install on ESP32: os-development/manual-install-esp32.md
5555
- Porting Guide: os-development/porting-guide.md
5656
- Other:
5757
- Release Process: other/release-checklist.md

0 commit comments

Comments
 (0)