EtchedPixels / FUZIX

FuzixOS: Because Small Is Beautiful
Other
2.13k stars 267 forks source link

Pi Pico port improvements #1050

Closed veremenko-y closed 3 months ago

veremenko-y commented 3 months ago
* /dev/tty1 is not fully blocking console for kput
* /dev/tty2-5 can be configured as independent USB ttys
    * USB ttys operate through a small ring-buffer to minimize
      dropouts at high rate of transmission
* NAND flash (as block device) can be disabled in config to save 7KB of RAM
* /dev/pico device can be used to trigger reboot into flash mode.
  See utils/rpi script
* Trimmed pico SDK to save 5KB of RAM
* Patched ps to report number of used blocks (4KB) per process
* Misc fix of makeversion.c to prevent overflow
veremenko-y commented 3 months ago

@davidgiven Pinging you to help with the review. One thing that I'm not sure about is handling of interrupts. I had issues with deadlocks, and I think adding udata.u_ininterrupt to timer_tick_cbhelped, but I'm not sure if that's 100% correct, as I never fully track the deadlock down.

veremenko-y commented 3 months ago

I can't reproduce this build error locally

/usr/include/newlib/sys/_timeval.h:42:18: error: conflicting types for 'time_t'
   42 | typedef _TIME_T_ time_t;

I'm building with the newer version of newlib though. What do you want me to do in this case? E.g. leave it, or should I get an ubuntu VM and ensure it builds there as well?

Name            : arm-none-eabi-newlib
Version         : 4.4.0.20231231-1
EtchedPixels commented 3 months ago

Can we split this up a bit. It's very hard to navigate all the bits that do differing things.

  1. Fix cleanups and Makefiles
  2. The USB serial changes
  3. The flash device disable (which btw you can do far more easily by simply not registering it in the first place)
  4. The ps changes
  5. SDK trim
  6. Makeversion changes

For the extra device I think it would be better to instead define CONFIG_DEV_PLATFORM at which point misc dev minor 6 ioctls call plt_dev_ioctl to implement any platform specific stuff that doesn't fit anywhere else. Eg the COCO3 port uses it for hooking SWI2/3 for emulating Flex and OS/9 stuff.

veremenko-y commented 3 months ago

Absolutely. I got a bit carried away with the changes. I'll split and push them as separate PRs.

For the extra device I think it would be better to instead define CONFIG_DEV_PLATFORM

This is the part of the change I wasn't sure about. Thank you for the info. I'll rewrite the device portion.