NAND(4)
π NAND(4) β the Kernel Interfaces Manual glow-up π
okay bestie, sit down, hydrate, and let me tell you about nand β the NAND Flash framework. yes it's a whole framework. yes it lives in the kernel. yes it's iconic. π
β¨ NAME β¨
nand β the NAND Flash framework, aka the girlboss of flash memory management π
πΈ SYNOPSIS πΈ
device nand
that's it. that's the whole vibe. one line. slay. β¨
π¦ DESCRIPTION π¦
so the FreeBSD nand framework is basically a set of interfaces that are lowkey obsessed with two things: giving you an extensible, object oriented environment for NAND controllers and NAND Flash memory chips from allllll kinds of different hardware vendors, and letting you manage all those NAND devices in a uniform, flexible way. it's giving "one framework to rule them all" energy. π
it's made up of these major components, and no I will not be skipping any of them:
- NAND Flash controller (NFC) interface. π₯
this one defines the methods that let you send commands, and send/receive data between the controller and a NAND chip. back-end drivers for specific NAND controllers plug into this interface and implement the low-level routines for whatever NAND controller they're repping.
this layer implements the basic functionality of a NAND Flash controller. it lets you send command and address to the chip, drive CS (that's the chip select line bestie), and read/write to the selected NAND chip. and the way this layer is independent of the NAND chip devices actually connected to the controller? we love a self-sufficient queen. π
- NAND chip interface. π
this one gives you the basic operations like read page, program page, erase block. currently there are three generic classes of drivers available, which provide support for these chips:
- large page
- small page
- ONFI-compliant
this layer implements the basic operations to be performed on a NAND chip, like read, program, erase, get status etc. and since these operations use specific commands (and yes, it depends on the vendor), each chip potentially has its own implementation of the command set. no two chips are the same and honestly? respect.
the framework is extensible, so it's also possible to create a custom command set for non standard chip support. build your own, main character energy. β¨
- NANDbus. π
this layer is responsible for enumerating NAND chips in the system and establishing the hierarchy between chips and their supervising controllers. it's basically the group chat admin.
its main purpose is detecting the type of NAND chips connected to a given chip select (CS line). it also allows manages locking access to the NAND controller (yes the original says "allows manages", and honestly, same, words are hard). NANDbus passes requests from an active chip to the chip controller. it's a whole relay system and it's serving. π«Ά
- NAND character / GEOM device. π
for each NAND chip found in a system, a character and GEOM devices are created which allows to read / write directly to a device, as well as perform other specific operations (like via ioctl). ngl that's convenient.
there are two GEOM devices created for each NAND chip:
- raw device
- normal device
raw device allows to bypass ECC checking when reading/writing to it, while normal device always uses the ECC algorithm to validate the read data. choose your fighter. π
NAND character devices will be created for each NAND chip detected while probing the NAND controller. so like, automatic. no cap. π
π SEE ALSO π
libnandfs(3)gnand(4)nandsim(4)nandfs(5)makefs(8)mount_nandfs(8)nandfs(8)nandsim(8)nandtool(8)newfs_nandfs(8)umount_nandfs(8)
go read those too, they're all part of the extended universe. πβ¨
β STANDARDS β
Open NAND Flash Interface Working Group (ONFI). that's the standard, and we respect it. π
π HISTORY π
the nand framework support first appeared in FreeBSD 10.0. so it's been here, being iconic, since 10.0. periodt. π
π§ AUTHORS π§
the nand framework was designed and developed by Grzegorz Bernacki. this manual page was written by Rafal Jaworowski. absolute legends, both of them, we stan. ππ
and that's the tea, bestie β this page came to you from the Debian fam, dated March 8, 2012, filed under NAND(4) in the Kernel Interfaces Manual. mwah, go flash something responsibly π
β¨π¦
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 2012 The FreeBSD Foundation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms