MrRockchip

draft1

Feb 9th, 2026 (edited)
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.65 KB | None | 0 0
  1. # FLOPPINUX - An Embedded 🐧Linux on a Single 💾Floppy
  2. ## 2026 Edition (v0.3.1-amd64net)
  3.  
  4. - v0.3.1-amd64net - **February 09, 2026**
  5. - v0.3.1 - **December 21, 2025**
  6. - v0.3.0 - **October 19, 2025**
  7.  
  8. ---
  9.  
  10. **This is a modified floppinux "amd64net" distribution. It is primarily aimed for embedding as a virtual floppy into the opensource coreboot BIOS of supported AMD PCs ( more information here - http://dangerousprototypes.com/docs/Lenovo_G505S_hacking ), however it may be used for other needs as well. Main features:
  11.  
  12. - Architecture changes
  13. - 2.88 MB floppy image for AMD PCs of x86_64 architecture (seems to work fine in VirtualBox too), with many AMD-specific features enabled
  14. - Intel CPU support is disabled to save space, however you may re-enable it at cost of something else and use this distro on your Intel
  15. - Microcode loading is disabled because thanks to opensource coreboot BIOS I don't need this space-taking feature at my operating system
  16. - Device support
  17. - Ethernet
  18. - Qualcomm/Atheros AR8161/AR8162/QCA8171/QCA8172 - found in coreboot-supported AMD Lenovo G505S laptop
  19. - Realtek RTL8111/RTL8168/RTL8169/RTL8101/RTL8125 - found in coreboot-supported ASUS A88XM-E & AM1I-A desktops and dirt cheap PCIe Ethernet cards
  20. - WiFi
  21. - Atheros ath9k family of PCIe WiFi adapters, such as AR9462 that works on 100% opensource without any firmware
  22. - Atheros ath9k_htc family of USB WiFi adapters, such as AR9271 that seems to need a firmware for unknown reasons
  23. - ACPI:
  24. - Had to enable it in order for AR9271 USB WiFi to work on coreboot-supported AMD Lenovo G505S laptop, at cost of disabling printk because this ACPI is way too fat
  25. - Software additions
  26. - wpa_supplicant and wpa_cli
  27. - This standalone software is essential for connecting to WiFi networks with the supported WiFi adapters
  28. - Dropbear ssh and scp
  29. - This standalone software is essential for connecting to other PCs over SSH protocol and therefore providing a "thin client" functionality
  30. - Kirc IRC client
  31. - This standalone software is essential for connecting to IRC servers and communicating with other people
  32.  
  33. Also, I have fixed many bugs like a frozen ping _(had to enable more timer-related features)_ and Ctrl+C/Ctrl+Z interrupts _(changes related to TTY and job control)_.
  34.  
  35. **The instructions below are originally provided by @w84death and have been heavily modded by me for this "amd64net" distribution.**
  36.  
  37. > FLOPPINUX was released in 2021. After four years people find it helpful. Because of that I decided to revisit FLOPPINUX in 2025 and make updated tutorial. This brings bunch of updates like latest kernel and persistent storage.
  38.  
  39. ## Table of Contents
  40.  
  41. - [Main Project Goals](#main-project-goals)
  42. - [Core Features](#core-features)
  43. - [Linux Kernel](#linux-kernel)
  44. - [64-bit Base OS](#64-bit-base-os)
  45. - [Working Directory](#working-directory)
  46. - [Host OS Requirements](#host-os-requirements)
  47. - [System Requirements](#system-requirements)
  48. - [Emulation](#emulation)
  49. - [Compile Kernel](#compile-kernel)
  50. - [Toolset](#toolset)
  51. - [Filesystem](#filesystem)
  52. - [Boot Image](#boot-image)
  53. - [Floppy Disk](#floppy-disk)
  54. - [Summary](#summary)
  55. - [Download](#download)
  56.  
  57. ## Main Project Goals
  58.  
  59. Think of this as Linux From Scratch but for making single floppy distribution.
  60.  
  61. > It is meant to be a full workshop (tutorial) that you can follow easily and modify it to your needs. It is a learning exercise. Some base Linux knowledge is needed.
  62.  
  63. The final distribution is very simple and consists only of minimum of tools and hardware support. As a user you will be able to boot any PC with a floppy drive to a Linux terminal, edit files, and create simple scripts. There is 264KB of space left for your newly created files.
  64.  
  65. ## Core Features
  66.  
  67. - Fully working distribution booting from the single 2.88 MB floppy
  68. - Latest Linux kernel
  69. - Supporting AMD x86_64 CPUs
  70. - Have a working text editor (Vi) and basic file manipulation commands (move, rename, delete, etc.)
  71. - Have a basic Ethernet/WiFi networking
  72. - Support for simple scripting
  73. - Persistent storage on the floppy to actualy save files
  74. - Works on real hardware and emulation
  75.  
  76. ## Linux Kernel
  77.  
  78. **6.18.9** (released February 2026) is the latest version at the time of writing with full compatibility.
  79.  
  80. ## 64-bit Base OS
  81.  
  82. This time I will do everything on **Artix** Linux _(Arch without SystemD)_. It is 64-bit operating system based on Arch Linux with a true init freedom. Instructions should work on all POSIX systems. Only difference is getting needed packages.
  83.  
  84. ## Working Directory
  85.  
  86. **To avoid the possible issues with `~`, I will be using the absolute pathes for `artix` user. If you want these instructions to be copy-paste'able AS-IS, temporarily make a symbolic link:**
  87.  
  88. ```bash
  89. cd /home/
  90. sudo ln -s ./my_username/ ./artix
  91. cd ./artix/
  92. ```
  93.  
  94. Create directory where you will keep all the files.
  95.  
  96. ```bash
  97. mkdir /home/artix/my-floppy-distro/
  98. cd /home/artix/my-floppy-distro/
  99. ```
  100.  
  101. ## Host OS Requirements
  102.  
  103. > You need supporting software to build things. This exact list may vary depending on the system you have.
  104.  
  105. Install needed software/libs. On Artix:
  106.  
  107. ```bash
  108. sudo pacman -S bc bison cmocka coreutils cpio curl flex gcc m4 make ncurses nss openssl p7zip patch pkgconf syslinux unzip wget xxd zlib git
  109. ```
  110.  
  111. You will also have to enable the Arch Linux "extra" repository in order to get the `sstrip` utility for reducing the ELF file sizes:
  112.  
  113. ```bash
  114. sudo pacman -S artix-archlinux-support
  115. sudo pacman-key --populate archlinux
  116. sudo nano /etc/pacman.conf
  117. ---
  118. ==> Add the arch repos in pacman.conf:
  119.  
  120. #[extra-testing]
  121. #Include = /etc/pacman.d/mirrorlist-arch
  122.  
  123.  
  124. [extra]
  125. Include = /etc/pacman.d/mirrorlist-arch
  126.  
  127.  
  128. #[multilib-testing]
  129. #Include = /etc/pacman.d/mirrorlist-arch
  130.  
  131.  
  132. #[multilib]
  133. #Include = /etc/pacman.d/mirrorlist-arch
  134. ---
  135. sudo pacman -Sy
  136. sudo pacman -S elfkickers
  137. ```
  138.  
  139. Cross-compiler:
  140.  
  141. ```bash
  142. wget https://musl.cc/x86_64-linux-musl-cross.tgz
  143. tar -xvf ./x86_64-linux-musl-cross.tgz
  144. ```
  145.  
  146. ## System Requirements
  147.  
  148. - AMD x86_64 CPU _(you could switch to Intel with a Linux kernel config change)_
  149. - 32MB RAM _(approximately, rounded up to a degree of 2, needs to be tested)_
  150. - 2.88MB ED Floppy disk , either virtual _(part of coreboot+SeaBIOS)_ or physical
  151.  
  152. ## Emulation
  153.  
  154. > 86Box is also good but slower. Bochs is the best but for debugging, not needed here.
  155.  
  156. For emulation you may use qemu.
  157.  
  158. ```bash
  159. sudo pacman -S qemu-full
  160. ```
  161.  
  162. Alternatively, VirtualBox may be used.
  163.  
  164. ```bash
  165. sudo pacman -S virtualbox
  166. ```
  167.  
  168. ## Kernel
  169.  
  170. Get the sources for the latest compatible **kernel 6.18.9**:
  171.  
  172. ```bash
  173. git clone --depth=1 --branch v6.18.9 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
  174.  
  175. ```
  176.  
  177. After switching to a `./linux/` directory, replace the non-0 optimization flags with -Oz for an aggressive size optimization:
  178.  
  179. ```bash
  180. cd ./linux/
  181. mv ./.git/ ./../temp.git/ # Temporarily move ./.git/ to avoid damaging its contents in the process
  182. find . -type f -print0 | xargs -0 sed -i -e "s/-O1/-Oz/g"
  183. find . -type f -print0 | xargs -0 sed -i -e "s/-O2/-Oz/g"
  184. find . -type f -print0 | xargs -0 sed -i -e "s/-O3/-Oz/g"
  185. find . -type f -print0 | xargs -0 sed -i -e "s/-Os/-Oz/g"
  186. mv ./../temp.git/ ./.git/
  187. ```
  188.  
  189. In order for your further changes to be easily noticeable, lets make a local commit of these "-Oz" changes. Check your `.gitconfig` contents:
  190. ```bash
  191. cat /home/artix/.gitconfig
  192. ```
  193.  
  194. If it is empty, do the following setup:
  195.  
  196. ```bash
  197. git config --global user.name "Your Name"
  198. git config --global user.email "[email protected]"
  199. ```
  200.  
  201. Now, lets commit the changes:
  202.  
  203. ```bash
  204. git add .
  205. git commit -m "Upgrade the sources to -Oz optimization"
  206. ```
  207.  
  208. Disable the microcode loading:
  209.  
  210. ```bash
  211. leafpad ./arch/x86/Kconfig
  212. # Scroll down to line 1320
  213. ---
  214. config MICROCODE
  215. - def_bool y
  216. + def_bool n
  217. depends on CPU_SUP_AMD || CPU_SUP_INTEL
  218. select CRYPTO_LIB_SHA256 if CPU_SUP_AMD
  219. ---
  220. ```
  221.  
  222. Also, disable the networking selftests:
  223.  
  224. ```bash
  225. leafpad ./net/Kconfig
  226. # Scroll down to line 480
  227. ---
  228. config NET_SELFTESTS
  229. - def_tristate PHYLIB
  230. - depends on PHYLIB && INET
  231. + bool
  232. + default n
  233. ---
  234. ```
  235.  
  236. Now, lets configure and build our custom kernel. First create tiniest base configuration:
  237.  
  238. ```bash
  239. make ARCH="x86_64" tinyconfig
  240. ```
  241.  
  242. > This is a bootstrap with absolute minimum features. Just enough to boot the system. We want a little bit more.
  243.  
  244. Add additonal config settings on top of it:
  245.  
  246. ```bash
  247. make ARCH="x86_64" menuconfig
  248. ```
  249. Important: Do not uncheck anything in options unless specified so. Some of those options are important. You can uncheck but on your own risk.
  250.  
  251. From menus choose those options:
  252.  
  253. - Power management and ACPI options
  254. - Device power management core functionality: CONFIG_PM
  255. - ACPI (Advanced Configuration and Power Interface) Support: CONFIG_ACPI
  256. - Disable "Allow upgrading ACPI tables via initrd": CONFIG_ACPI_TABLE_UPGRADE
  257. - Disable "Debug Statements": CONFIG_ACPI_DEBUG
  258. - CPU Frequency scaling
  259. - Disable "Intel P state control": CONFIG_X86_INTEL_PSTATE
  260. - Processor type and features
  261. - Symmetric multi-processing support: CONFIG_SMP
  262. - AMD ACPI2Platform devices support: CONFIG_X86_AMD_PLATFORM_DEVICE
  263. - Supported processor vendors: CONFIG_PROCESSOR_SELECT
  264. - Disable everything except "Support AMD processors": CONFIG_CPU_SUP_AMD
  265. - Performance monitoring
  266. - Disable "Intel/AMD rapl performance events": CONFIG_PERF_EVENTS_INTEL_RAPL
  267. - NUMA Memory Allocation and Scheduler Support: CONFIG_NUMA
  268. - General Setup
  269. - Kernel compression mode: CONFIG_KERNEL_XZ
  270. - Memory placement aware NUMA scheduler: CONFIG_NUMA_BALANCING
  271. - Initial RAM filesystem and RAM disk (initramfs/initrd)
  272. - Original instruction: Support initial ramdisk/ramfs compressed using XZ (CONFIG_RD_XZ) and **uncheck everything else**
  273. - My instruction: Support initial ramdisk/ramfs compressed using LZMA (CONFIG_RD_LZMA) and **uncheck everything else** (LZMA for rootfs gave me better results than XZ)
  274. - Configure standard kernel features (expert users)
  275. - Original instruction: Enable support for printk: CONFIG_PRINTK
  276. - My instruction: Do not enable support for printk (CONFIG_PRINTK) because it is way too fat
  277. - Posix Clocks & timers: CONFIG_POSIX_TIMERS
  278. - Enable futex support: CONFIG_FUTEX
  279. - Enable eventpoll support: CONFIG_EPOLL
  280. - Bus options
  281. - ISA-style DMA support: ISA_DMA_API (for ARCH_MAY_HAVE_PC_FDC for CONFIG_BLK_DEV_FD)
  282. - Enable the block layer: CONFIG_BLOCK
  283. - Executable file formats
  284. - Kernel support for ELF binaries: CONFIG_BINFMT_ELF
  285. - Kernel support for scripts starting with #!: CONFIG_BINFMT_SCRIPT
  286. - Memory Management options
  287. - Disable "Support for paging of anonymous memory (swap)": CONFIG_SWAP
  288. - Networking support: CONFIG_NET
  289. - Networking options
  290. - Packet socket: CONFIG_PACKET
  291. - Unix domain sockets: CONFIG_UNIX
  292. - TCP/IP networking: CONFIG_INET
  293. - Disable "INET: socket monitoring interface": CONFIG_INET_DIAG
  294. - Disable "The IPv6 protocol": CONFIG_IPV6
  295. - Disable "Receive packet steering": CONFIG_RPS
  296. - Wireless: CONFIG_WIRELESS
  297. - cfg80211 - wireless configuration API: CONFIG_CFG80211
  298. - Disable "Support CRDA": CONFIG_CFG80211_CRDA_SUPPORT
  299. - Generic IEEE 802.11 Networking Stack (mac80211): CONFIG_MAC80211
  300. - cfg80211 certification onus: CONFIG_CFG80211_CERTIFICATION_ONUS
  301. - Disable "require regdb signature": CONFIG_CFG80211_REQUIRE_SIGNED_REGDB
  302. - Disable "Netlink interface for ethtool": CONFIG_ETHTOOL_NETLINK
  303. - Device Drivers
  304. - PCI Support: CONFIG_PCI
  305. - Disable "VGA Arbitration": CONFIG_VGA_ARB
  306. - Generic Driver Options
  307. - Maintain a devtmpfs filesystem to mount at /dev: CONFIG_DEVTMPFS
  308. - Automount devtmpfs at /dev, after the kernel mounted the rootfs: CONFIG_DEVTMPFS_MOUNT
  309. - Block devices
  310. - Normal floppydisk support: CONFIG_BLK_DEV_FD (depends on ISA_DMA_API for ARCH_MAY_HAVE_PC_FDC)
  311. - RAM block device support: CONFIG_BLK_DEV_RAM
  312. - Default number of RAM disk: 1 (CONFIG_BLK_DEV_RAM_COUNT)
  313. - Misc devices
  314. - Disable "Intel Management Engine Interface": CONFIG_INTEL_MEI
  315. - USB support: CONFIG_USB_SUPPORT
  316. - Support for Host-side USB: CONFIG_USB
  317. - EHCI HCD (USB 2.0) support: CONFIG_USB_EHCI_HCD
  318. - OHCI HCD (USB 1.1) support: CONFIG_USB_OHCI_HCD
  319. - Network device support: CONFIG_NETDEVICES
  320. - Disable "Network core driver support": CONFIG_NET_CORE
  321. - Ethernet driver support: CONFIG_ETHERNET
  322. - **Uncheck everything there before proceeding**
  323. - AMD devices: CONFIG_NET_VENDOR_AMD
  324. - AMD PCnet32 PCI support: CONFIG_PCNET32 (for VirtualBox)
  325. - Atheros devices: CONFIG_NET_VENDOR_ATHEROS
  326. - Qualcomm Atheros AR816x/AR817x support: CONFIG_ALX
  327. - Realtek devices: CONFIG_NET_VENDOR_REALTEK
  328. - Realtek 8169/8168/8101/8125 ethernet support: CONFIG_R8169 (also supports 8111)
  329. - Wireless LAN: CONFIG_WLAN
  330. - **Uncheck everything there before proceeding**
  331. - Atheros/Qualcomm devices: CONFIG_WLAN_VENDOR_ATH
  332. - Atheros 802.11n wireless cards support: CONFIG_ATH9K
  333. - Disable "Atheros bluetooth coexistence support": CONFIG_ATH9K_BTCOEX_SUPPORT (we did not enable the Bluetooth of AR9462 card)
  334. - Atheros ath9k ACK timeout estimation algorithm: CONFIG_ATH9K_DYNACK
  335. - Atheros HTC based wireless cards support: CONFIG_ATH9K_HTC
  336. - Input device support
  337. - Generic input layer (needed for keyboard, mouse, ...): CONFIG_INPUT
  338. - Mice: CONFIG_INPUT_MOUSE
  339. - Elantech PS/2 protocol extension: CONFIG_MOUSE_PS2_ELANTECH (may be a part of AMD Lenovo G505S laptop)
  340. - Hardware I/O ports
  341. - Disable "Serial port line discipline": CONFIG_SERIO_SERPORT
  342. - Character devices
  343. - Enable TTY: CONFIG_TTY
  344. - Disable "Unix98 PTY support": CONFIG_UNIX98_PTYS
  345. - Disable "Legacy (BSD) PTY support": CONFIG_LEGACY_PTYS
  346. - Disable "PPS support": CONFIG_PPS
  347. - PTP clock support
  348. - Disable "PTP clock support": CONFIG_PTP_1588_CLOCK
  349. - Pin controllers: CONFIG_PINCTRL
  350. - AMD GPIO pin control: CONFIG_PINCTRL_AMD
  351. - GPIO support
  352. - Disable "Character device (/dev/gpiochipN) support": CONFIG_GPIO_CDEV
  353. - Thermal drivers
  354. - Disable "Thermal netlink management": CONFIG_THERMAL_NETLINK
  355. - Real Time Clock: CONFIG_RTC_CLASS
  356. - NVMEM Support:
  357. - Disable "/sys/bus/nvmem/devices/*/nvmem (sysfs interface)": CONFIG_NVMEM_SYSFS
  358. - File systems
  359. - DOS/FAT/EXFAT/NT Filesystems
  360. - MSDOS fs support: CONFIG_MSDOS_FS
  361. - Pseudo filesystems
  362. - /proc file system support: CONFIG_PROC_FS
  363. - sysfs file system support: CONFIG_SYSFS
  364. - Disable "Enable /proc page monitoring": CONFIG_PROC_PAGE_MONITOR
  365. - Disable "Network File Systems": CONFIG_NETWORK_FILESYSTEMS
  366. - Native language support
  367. - Codepage 437: CONFIG_NLS_CODEPAGE_437
  368. - Security options
  369. - Disable "Enable access key retention support": CONFIG_KEYS
  370. - Cryptographic API
  371. - Public-key cryptography
  372. - Disable "RSA (Rivest-Shamir-Adleman): CONFIG_CRYPTO_RSA
  373. - Hashes, digests, and MACs
  374. - Disable "SHA-224 and SHA-256": CONFIG_CRYPTO_SHA256
  375. - Disable "Hardware crypto devices": CONFIG_CRYPTO_HW
  376. - Disable "Asymmetric (public-key cryptographic) key type": CONFIG_ASYMMETRIC_KEY_TYPE
  377. - Library routines
  378. - Original instruction: XZ decompression: CONFIG_DECOMPRESS_XZ (selected by RD_XZ && BLK_DEV_INITRD)
  379. - My instruction: LZMA decompression: CONFIG_DECOMPRESS_LZMA (selected by RD_LZMA && BLK_DEV_INITRD)
  380.  
  381. Exit configuration (yes, save settings to .config).
  382.  
  383. Time for compiling!
  384.  
  385. ### Compile Kernel
  386.  
  387. ```bash
  388. make ARCH="x86_64" clean && make ARCH="x86_64" bzImage -j$(nproc)
  389. ```
  390.  
  391. This will take a while depending on the speed of your CPU. In the end the kernel will be created in **arch/x86/boot/** as **bzImage** file.
  392.  
  393. Copy kernel to our **main directory** and **go back to it**:
  394.  
  395. ```bash
  396. cp ./arch/x86_64/boot/bzImage ./../
  397. cd ./../
  398. ```
  399.  
  400. ## Dropbear
  401.  
  402.  
  403.  
  404. ## WPA Supplicant
  405.  
  406. ## KIRC
  407.  
  408. ## Toolset
  409.  
  410. Without tools kernel will just boot and you will not be able to do anything. One of the most popular lightweight tools is BusyBox. It replaces the standard GNU utilities with way smaller but still functional alternatives, perfect for embedded needs.
  411.  
  412. Get the **1.37.0** version from busybox.net or Github mirror. Download the file, extract it, and change directory:
  413.  
  414. > Remember to be in the working directory.
  415.  
  416. ```bash
  417. git clone --depth=1 --branch 1_37_stable https://git.busybox.net/busybox.git
  418. ```
  419.  
  420. After switching to a `./busybox/` directory, replace the O2 optimization flags with -Os for a size optimization: _(musl.cc toolchain's GCC is too old for -Oz)_
  421.  
  422. ```bash
  423. cd ./busybox/
  424. mv ./.git/ ./../temp.git/ # Temporarily move ./.git/ to avoid damaging its contents in the process
  425. find . -type f -print0 | xargs -0 sed -i -e "s/-O2/-Os/g"
  426. mv ./../temp.git/ ./.git/
  427. ```
  428.  
  429. As with kernel you need to create starting configuration:
  430.  
  431. ```bash
  432. make ARCH="x86_64" allnoconfig
  433. ```
  434.  
  435. > You may skip this following fix if you are building on Debian/Fedora
  436.  
  437. Fix for **GCC 14+ Linux based distributions** like Arch:
  438.  
  439. ```bash
  440. sed -i "s/main() {}/int main() {}/" ./scripts/kconfig/lxdialog/check-lxdialog.sh
  441. ```
  442.  
  443. > Now the fun part. You need to **choose what tools you want**. Each menu entry will show how much more KB will be taken if you choose it. So choose it wisely :) For the first time use my selection.
  444.  
  445. Run the configurator:
  446.  
  447. ```bash
  448. make ARCH="x86_64" menuconfig
  449. ```
  450.  
  451. Choose the following options. Remember to **do not uncheck** anything if not stated here.
  452.  
  453. - Settings
  454. - Support --long-options: CONFIG_LONG_OPTS
  455. - Support files > 2 GB: CONFIG_LFS
  456. - Build static binary (no shared libs): CONFIG_STATIC
  457. - Use sendfile system call: CONFIG_FEATURE_USE_SENDFILE
  458. - Use clock_gettime(CLOCK_MONOTONIC) syscall: CONFIG_MONOTONIC_SYSCALL
  459. - Coreutils
  460. - cat: CONFIG_CAT
  461. - chmod: CONFIG_CHMOD
  462. - cp: CONFIG_CP
  463. - date: CONFIG_DATE
  464. - df: CONFIG_DF
  465. - echo: CONFIG_ECHO
  466. - ln: CONFIG_LN
  467. - ls: CONFIG_LS
  468. - mkdir: CONFIG_MKDIR
  469. - mv: CONFIG_MV
  470. - pwd: CONFIG_PWD
  471. - rm: CONFIG_RM
  472. - sleep: CONFIG_SLEEP
  473. - sync: CONFIG_SYNC
  474. - test: CONFIG_TEST
  475. - test as [: CONFIG_TEST1
  476. - test as [[: CONFIG_TEST2
  477. - timeout: CONFIG_TIMEOUT
  478. - Console Utilities
  479. - clear: CONFIG_CLEAR
  480. - Editors
  481. - vi: CONFIG_VI
  482. - Init Utilities
  483. - init: CONFIG_INIT
  484. - **uncheck** everything else (inside init: keep [*] only on init in this page)
  485. - Linux System Utilities
  486. - lsusb: CONFIG_LSUSB
  487. - lspci: CONFIG_LSPCI
  488. - mdev: CONFIG_MDEV
  489. - mount: CONFIG_MOUNT
  490. - Support lots of -o flags: CONFIG_FEATURE_MOUNT_FLAGS
  491. - **uncheck** everything else
  492. - setsid: CONFIG_SETSID
  493. - umount: CONFIG_UMOUNT
  494. - Miscellaneous Utilities
  495. - beep: CONFIG_BEEP
  496. - **uncheck** readahead: CONFIG_READAHEAD
  497. - Networking Utilities
  498. - hostname: CONFIG_HOSTNAME
  499. - ifconfig: CONFIG_IFCONFIG
  500. - ifplugd: CONFIG_IFPLUGD
  501. - nslookup: CONFIG_NSLOOKUP
  502. - ping: CONFIG_PING
  503. - route: CONFIG_ROUTE
  504. - wget: CONFIG_WGET
  505. - udhcpc: CONFIG_UDHCPC
  506. - Absolute path to config script (CONFIG_UDHCPC_DEFAULT_SCRIPT): /etc/udhcpc.sh
  507. - Process Utilities
  508. - free: CONFIG_FREE
  509. - kill: CONFIG_KILL
  510. - ps: CONFIG_PS
  511. - pstree: CONFIG_PSTREE
  512. - top: CONFIG_TOP
  513. - uptime: CONFIG_UPTIME
  514. - Shells
  515. - Choose alias as (ash): CONFIG_SH_IS_ASH
  516. - ash: CONFIG_ASH
  517. - Optimize for size instead of speed: CONFIG_ASH_OPTIMIZE_FOR_SIZE
  518. - Job control: CONFIG_ASH_JOB_CONTROL
  519. - Alias support: CONFIG_ASH_ALIAS
  520. - cttyhack: CONFIG_CTTYHACK
  521. <!--- Help support-->
  522.  
  523. Now exit with save config.
  524.  
  525. ### Cross Compiler Setup
  526.  
  527. > Our target system needs to be 64-bit MUSL. To compile it on 64-bit no-MUSL system we need a cross compiler. You can setup this by hand in the menuconfig or just copy and paste those four lines.
  528.  
  529. Setup paths:
  530.  
  531. ```bash
  532. sed -i "s|.*CONFIG_CROSS_COMPILER_PREFIX.*|CONFIG_CROSS_COMPILER_PREFIX=\"/home/artix/my-floppy-distro/x86_64-linux-musl-cross/bin/x86_64-linux-musl-\"|" ./.config
  533.  
  534. sed -i "s|.*CONFIG_SYSROOT.*|CONFIG_SYSROOT=\"/home/artix/my-floppy-distro/x86_64-linux-musl-cross\"|" ./.config
  535.  
  536. sed -i "s|.*CONFIG_EXTRA_CFLAGS.*|CONFIG_EXTRA_CFLAGS=\"-I/home/artix/my-floppy-distro/x86_64-linux-musl-cross/include -static -Os -s -ffunction-sections -fdata-sections -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-stack-protector -fomit-frame-pointer -fmerge-all-constants -fno-ident -fno-math-errno -fno-unroll-loops -ffast-math -fno-plt -fvisibility=hidden -fno-exceptions -march=x86-64 -mtune=generic -fno-align-functions -fno-align-jumps -fno-align-loops -fno-align-labels\"|" ./.config
  537.  
  538. sed -i "s|.*CONFIG_EXTRA_LDFLAGS.*|CONFIG_EXTRA_LDFLAGS=\"-L/home/artix/my-floppy-distro/x86_64-linux-musl-cross/lib -static -s -Wl,--gc-sections -Wl,--strip-all -Wl,--build-id=none -Wl,-z,norelro -Wl,--hash-style=sysv -Wl,--no-eh-frame-hdr -Wl,-z,noseparate-code -Wl,--no-undefined-version -Wl,--as-needed -Wl,--sort-common -Wl,--sort-section=alignment -Wl,--compress-debug-sections=none -Wl,--warn-common -Wl,--fatal-warnings -Wl,--discard-all -Wl,--discard-locals -Wl,--no-ld-generated-unwind-info -Wl,--orphan-handling=place -no-pie\"|" ./.config
  539. ```
  540.  
  541. ### Compile BusyBox
  542.  
  543. Build tools and create base filesystem ("install"). It will ask for options, just **press enter** for default for all of them.
  544.  
  545. ```bash
  546. make ARCH="x86_64" clean && make ARCH="x86_64" -j$(nproc) && sstrip ./busybox && make ARCH="x86_64" install
  547. ```
  548.  
  549. This will create a filesystem with all the files at `./_install/`. Move it to our main directory with renaming and go to it.
  550.  
  551. ```bash
  552. mv ./_install/ ./../filesystem
  553. cd ./../filesystem/
  554. ```
  555.  
  556. ## Filesystem
  557.  
  558. You got kernel and basic tools but the system still needs some additional directory structure.
  559.  
  560. > This created minimum viable directory structure for satisfying the basic requirements of a Linux system.
  561.  
  562. > Remember to be in the ./filesystem/ directory.
  563.  
  564. ```bash
  565. mkdir -pv {dev,proc,etc/init.d,sys,tmp,home,var/run,lib/firmware/ath9k_htc,lib/firmware/rtl_nic}
  566. sudo mknod ./dev/console c 5 1
  567. sudo mknod ./dev/null c 1 3
  568. ```
  569.  
  570. Next step is to add minimum configuration files. First one is a welcome message that will be shown after booting.
  571.  
  572. > Here is the first real opportunity to go wild and make this your own signature.
  573.  
  574. ```bash
  575. cat >> ./welcome << EOF
  576. Your welome message or ASCII art.
  577. EOF
  578. ```
  579.  
  580. Or download my `welcome` file.
  581.  
  582. ```bash
  583. wget https://raw.githubusercontent.com/mikebdp2/floppinux-amd64net/refs/heads/main/welcome
  584. ```
  585.  
  586. It looks like that:
  587.  
  588. ```
  589. $ cat ./welcome
  590.  
  591. __________________
  592. /_/ FLOPPINUX /_/;
  593. / ' boot disk ' //
  594. / '-------------' //
  595. / .---------. //
  596. / / AMD64NET / //
  597. .___/__________/__// 2880KiB
  598. '===\__________\==' 3.5"
  599.  
  600. ______ FLOPPINUX_V_0.3.1-AMD64NET _________________________
  601. ______ AN_EMBEDDED_SINGLE_FLOPPY_LINUX_DISTRIBUTION _______
  602. ______ BY_KRZYSZTOF_KRYSTIAN_JANKOWSKI_AND_MIKE_BANON _____
  603. ______ 2026.02 ____________________________________________
  604. ```
  605.  
  606. > Back to serious stuff. Inittab tells the system what to do in critical states like starting, exiting and restarting. It points to the initialization script rc that is the first thing that our OS will run before dropping into the shell.
  607.  
  608. Create an inittab file:
  609.  
  610. ```bash
  611. cat >> ./etc/inittab << EOF
  612. ::sysinit:/etc/init.d/rc
  613. ::askfirst:/usr/bin/setsid /bin/cttyhack /bin/sh
  614. ::respawn:/usr/bin/setsid /bin/cttyhack /bin/sh
  615. ::restart:/sbin/init
  616. ::ctrlaltdel:/sbin/reboot
  617. ::shutdown:/bin/umount -a -r
  618. EOF
  619. ```
  620.  
  621. And the init rc script:
  622.  
  623. ```bash
  624. cat >> ./etc/init.d/rc << EOF
  625. #!/bin/sh
  626. mount -t proc none /proc
  627. mount -t sysfs none /sys
  628. mdev -s
  629. ln -s /proc/mounts /etc/mtab
  630. mkdir -p /mnt /home
  631. mount -t msdos -o rw /dev/fd0 /mnt
  632. mkdir -p /mnt/data
  633. mount --bind /mnt/data /home
  634. clear
  635. cat ./welcome
  636. cd /home/
  637. udhcpc -i eth0 -q &
  638. /usr/bin/setsid /bin/cttyhack /bin/sh
  639. EOF
  640. ```
  641.  
  642. And the udhcpc script:
  643.  
  644. ```bash
  645. cat >> ./etc/udhcpc.sh << EOF
  646. #!/bin/sh
  647. case "\$1" in
  648. bound|renew)
  649. # Apply the IP address and subnet mask
  650. ifconfig \$interface \$ip netmask \$subnet up
  651.  
  652. # Set default gateway if provided
  653. if [ -n "\$router" ]; then
  654. # Remove any existing default route
  655. route del default 2>/dev/null
  656. # Add new default route (use first router if multiple)
  657. for gw in \$router; do
  658. route add default gw \$gw dev \$interface
  659. break
  660. done
  661. fi
  662.  
  663. # Set DNS servers if provided
  664. if [ -n "\$dns" ]; then
  665. echo -n > /etc/resolv.conf
  666. for ns in \$dns; do
  667. echo "nameserver \$ns" >> /etc/resolv.conf
  668. done
  669. fi
  670. ;;
  671. deconfig)
  672. # Clear configuration when interface goes down
  673. ifconfig \$interface 0.0.0.0
  674. ;;
  675. esac
  676.  
  677. exit 0
  678. EOF
  679. ```
  680.  
  681. And the wpa_supplicant config:
  682.  
  683. ```bash
  684. cat >> ./etc/wpa_supplicant.conf << EOF
  685. ctrl_interface=/var/run/wpa_supplicant
  686. update_config=1
  687. EOF
  688. ```
  689.  
  690. Copy the files that will be created as a part of subsequent instructions:
  691.  
  692. ```bash
  693. cp ./../dropbear/dbclient ./usr/bin/dbclient
  694. cp ./../dropbear/scp ./usr/bin/scp
  695. cp ./../hostap/wpa_supplicant/wpa_supplicant ./usr/bin/wpa_supplicant
  696. cp ./../hostap/wpa_supplicant/wpa_cli ./usr/bin/wpa_cli
  697. cp ./../linux-firmware/ath9k_htc/htc_9271-1.4.0.fw ./lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
  698. cp ./../linux-firmware/rtl_nic/rtl816* ./lib/firmware/rtl_nic/
  699. cd ./usr/bin/
  700. ln -s ./dbclient ./ssh
  701. cd ./../../
  702. ```
  703.  
  704. Make the scripts executable and give the ownership of all files to root:
  705.  
  706. ```bash
  707. chmod +x ./etc/init.d/rc
  708. chmod +x ./etc/udhcpc.sh
  709. sudo chown -R root:root ./
  710. ```
  711.  
  712. Compress this directory into one file. Then go back to working directory.
  713.  
  714. ```bash
  715. ### rm -f ./../rootfs.cpio.xz
  716. ### find . | cpio -H newc -o | xz --check=crc32 --lzma2=dict=512KiB -e > ./../rootfs.cpio.xz
  717. rm -f ./../rootfs.cpio.lzma
  718. find . | cpio -H newc -o | xz --format=lzma --check=crc32 --lzma1=dict=512KiB,preset=9e > ./../rootfs.cpio.lzma
  719. cd ./../
  720. ```
  721.  
  722. Create booting configuration.
  723.  
  724. > Another place to tweak parameters for your variant. Text after SAY is what will be displayed on the screen as first, usualy a name of the OS.
  725.  
  726. > The tsc=unstable is useful on some (real) computers to get rid of randomly shown warnings about Time Stamp Counter.
  727.  
  728. > Remember to be in the working directory.
  729.  
  730. ```bash
  731. cat >> ./syslinux.cfg << EOF
  732. DEFAULT floppinux
  733. LABEL floppinux
  734. SAY [ BOOTING FLOPPINUX VERSION 0.3.1-AMD64NET ]
  735. KERNEL bzImage
  736. INITRD rfscpiol.zma
  737. APPEND root=/dev/ram rdinit=/etc/init.d/rc console=tty0 tsc=unstable
  738. EOF
  739. ```
  740.  
  741. Make it executable:
  742.  
  743. ```bash
  744. chmod +x ./syslinux.cfg
  745. ```
  746.  
  747. Create sample file
  748.  
  749. > To make the system a little bit more user friendly I like to have a sample file that user will be able to read and edit. You can put anything you want in it. A simple help would be also a good idea to include.
  750.  
  751. ```bash
  752. cat >> ./hello.txt << EOF
  753. Hello, FLOPPINUX user!
  754. EOF
  755. ```
  756.  
  757. Filesystem is ready. Final step is to **put this all on a floppy**!
  758.  
  759. ## Boot Image
  760.  
  761. First we need an empty file in exact size of a floppy disk. Then format and make it bootable.
  762.  
  763. Create empty floppy image:
  764.  
  765. ```bash
  766. rm -f ./floppinux.img
  767. dd if=/dev/zero of=./floppinux.img bs=1k count=2880
  768. ```
  769.  
  770. Format it and create bootloader:
  771.  
  772. ```bash
  773. mkdosfs -n FLOPPINUX ./floppinux.img
  774. syslinux --install ./floppinux.img
  775. ```
  776.  
  777. Mount it and copy syslinux, kernel, and filesystem onto it:
  778.  
  779. ```bash
  780. sudo mount -o loop ./floppinux.img /mnt
  781. sudo mkdir /mnt/data
  782. sudo cp ./hello.txt /mnt/data/
  783. rm -f ./bzImage
  784. cp ./linux/arch/x86_64/boot/bzImage ./bzImage
  785. sudo cp ./bzImage /mnt
  786. sudo cp ./rootfs.cpio.lzma /mnt/rfscpiol.zma
  787. sudo cp ./syslinux.cfg /mnt
  788. df -h
  789. sudo umount /mnt
  790. ```
  791.  
  792. Done!
  793.  
  794. ### Test in emulator
  795.  
  796. It's good to test before wasting time for the real floppy to burn.
  797.  
  798. Boot the new OS in qemu:
  799.  
  800. ```bash
  801. qemu-system-x86_64 -fda ./floppinux.img -m 32M
  802. ```
  803.  
  804. If it worked that means You have successfully created your own distribution! Congratulations!
  805.  
  806. The **floppinux.img** image is ready to burn onto a floppy and boot on real hardware!
  807.  
  808. ## Floppy Disk
  809.  
  810. ### <!> Important <!>
  811.  
  812. Change XXX to floppy drive name in your system. In my case it is **sdb**. Choosing wrongly will NUKE YOUR PARTITION and REMOVE all of your files! Think twice. Or use some GUI application for that.
  813.  
  814. ```bash
  815. sudo dd if=./floppinux.img of=/dev/XXX bs=512 conv=notrunc,sync,fsync iflag=nocache oflag=direct status=progress
  816. ```
  817.  
  818. After 10 minutes I got a freshly burned floppy.
  819.  
  820. ## Debugging
  821.  
  822. If you need more verbose logging use those syslinux.cfg settings.
  823.  
  824. ```
  825. cat >> syslinux.cfg << EOF
  826. DEFAULT floppinux
  827. LABEL floppinux
  828. SAY [ BOOTING FLOPPINUX VERSION 0.3.1-AMD64NET DEBUG ]
  829. KERNEL bzImage
  830. INITRD rfscpiol.zma
  831. APPEND root=/dev/ram rdinit=/etc/init.d/rc console=tty0 ignore_loglevel earlyprintk=tty0 loglevel=8 tsc=unstable
  832. EOF
  833. ```
  834.  
  835. ## Summary
  836.  
  837. - FLOPPINUX: **0.3.1** (February 2026)
  838. - Linux Kernel: **6.18.9**
  839. - Busybox: **1.37.0**
  840. - Image size: 2880KiB / 2.88MiB
  841. - Kernel size: ???KiB (bzImage)
  842. - Tools: 137KiB (rfscpiol.zma)
  843. - Free space left (df -h): **???KiB**
  844.  
  845. ### System Tools
  846.  
  847. **TO BE EXPANDED**
  848.  
  849. #### File & Directory Manipulation
  850. - ```cat``` - display file contents
  851. - ```cp``` - copy files and directories
  852. - ```mv``` - move/rename files and directories
  853. - ```rm``` - remove files and directories
  854. - ```ls``` - list directory contents
  855. - ```mkdir``` - creates directory
  856.  
  857. #### System Information & Management
  858. - ```df -h``` - display filesystem disk space usage
  859. - ```sync``` - force write of buffered data to disk - use this after any changes to the floppy filesystem
  860. - ```mount``` - mount filesystems
  861. - ```umount``` - unmount filesystems
  862.  
  863. #### Text Processing & Output
  864. - ```echo``` - display text output
  865. - ```more``` - page through text output
  866.  
  867. #### Utilities
  868. - ```clear``` - clear terminal screen
  869. - ```test``` - evaluate conditional expressions
  870.  
  871. ### Applications
  872.  
  873. - ```vi``` - text editor
  874.  
  875. ## Download
  876.  
  877. - [ERROR - FLOPPINUX 0.3.1-AMD64NET Floppy Image 2.88MB](http://error.img)
  878.  
  879. ---
  880.  
  881. ```
  882. __________________
  883. /_/ FLOPPINUX /_/;
  884. / ' boot disk ' //
  885. / '-------------' //
  886. / .---------. //
  887. / / AMD64NET / //
  888. .___/__________/__// 2880KiB
  889. '===\__________\==' 3.5"
  890.  
  891.  
  892. Now go and make something fun with it!
  893. ```
  894.  
  895. **FLOPPINUX - An Embedded Single Floppy Linux Distribution**
  896. **By Krzysztof Krystian Jankowski and Mike Banon**
  897. **2026.02**
  898.  
Advertisement
Add Comment
Please, Sign In to add comment