tgoop.com/dereference_pointer_there/10128
Create:
Last Update:
Last Update:
Наконец-та!
Hosting a WebSite on a Disposable Vape
https://bogdanthegeek.github.io/blog/projects/vapeserver/
Сам сайт, который хостится - http://ewaste.fka.wtf/
"Железо"
- 24MHz Coretex M0+
- 24KiB of Flash Storage
- 3KiB of Static RAM
- a few peripherals, none of which we will use.
> This may not come as a surprise, but Linux (and with some tweaking even macOS) supports SLIP. The slattach utility can make any /dev/tty* send and receive IP packets. All we have to do is put the data down the wire in the right format and provide a virtual tty. This is actually easier than you might imagine, pyOCD can forward all semihosting though a telnet port. Then, we use socat to link that port to a virtual tty:
pyocd gdb -S -O semihost_console_type=telnet -T $(PORT) $(PYOCDFLAGS) &
socat PTY,link=$(TTY),raw,echo=0 TCP:localhost:$(PORT),nodelay &
sudo slattach -L -p slip -s 115200 $(TTY) &
sudo ip addr add 192.168.190.1 peer 192.168.190.2/24 dev sl0
sudo ip link set mtu 1500 up dev sl0
Для IP-стека был взят uIP - https://github.com/adamdunkels/uip (который был написан сразу хорошо и поэтому 12 лет не обновлялся 🌝)
Так же был реализован/портирован SLIP (Serial Line Internet Protocol) - старый протокол, который использовался для подключения через модемы
> If you are older than me, you might remember a time before Wi-Fi and Ethernet, the dark ages, when you had to use dial-up modems to get online. You might also know that the ghosts of those modems still linger all around us. Almost all USB serial devices actually emulate those modems: a 56k modem is just 57600 baud serial device. Data between some of these modems was transmitted using a protocol called SLIP (Serial Line Internet Protocol)
Сначала работало всё медленно, но после оптимизаций удалось достигнуть пинга в 20 мс, а загрузки страницы за 160 мс.
Реализация получилась такой компактной, что на веб-сервер удалось разместить текст оригинальной статьи
Memory region Used Size Region Size %age Used
FLASH: 5116 B 24 KB 20.82%
RAM: 1380 B 3 KB 44.92%
> As you may have noticed, we have just under 20kiB (80%) of storage space. That may not be enough to ship all of React, but as you can see, it’s more than enough to host this entire blog post.
Исходный код проекта
https://github.com/BogdanTheGeek/semihost-ip
BY Блог*

Share with your friend now:
tgoop.com/dereference_pointer_there/10128