I wonder if it is possible to run a Unix-based or Unix-like operating system (e.g FreeBSD or Linux) on an Arduino. I know Arduino has 32KB of flash memory and 2KB of SRAM.
I can use serial communication to see the output and send commands. Then a simple sketch will read the input and send it to the kernel.
I don't know if removing features from the source code helps a lot.
No. It is not possible in the "context" of usable OS.
The uC has no memory controller to map external RAM; thus some kludge would be needed from external circuitry.
Tiny Core is one of the smallest Linux distributions. It is a minimal Linux Kernel-based operating system focusing on offering a base system using BusyBox and FLTK. Console mode requires only 11MB, while GUI mode requires merely 16MB of space. If you have 64MB RAM, Tiny Core Linux functions effortlessly without GUI.
The first Arduino board based on an ARM processor. Features 2 channel 12-bit DAC, 84 MHz clock frequency, 32-bit architecture, 512 KB flash and 96 KB SRAM. Unlike most Arduino boards, it operates on 3.3 V and is not 5 V tolerant.
... but the Op stated UNO-level resources. As one works up the uC resources, theOp's question takes on a different context. In your reference, the context is:
Atmega1284p microcontroller running at 24MHz and added external DRAM module from old computer. Also he attached SD card to SPI interface and so he solved memory problem.
You and I together probably could not squeeze stuff into 2K of SRAM as mapping resources would be in contention with SD buffers and SPI for external RAM. It is even painful to get RTOS into a 2K of SRAM and still be able to generate a serial console prompt.