From nobody Mon Dec 18 21:12:17 2023 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SvCFr1SYmz53rTQ for ; Mon, 18 Dec 2023 21:12:32 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.75]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.kundenserver.de", Issuer "Telekom Security ServerID OV Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvCFq2Bxtz3VXH for ; Mon, 18 Dec 2023 21:12:31 +0000 (UTC) (envelope-from freebsd@edvax.de) Authentication-Results: mx1.freebsd.org; none Received: from terra.edvax.de ([178.12.41.184]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1Mgvn9-1qnxdm0xRd-00hPYz; Mon, 18 Dec 2023 22:12:27 +0100 Received: from r56.edvax.de (r56 [10.200.1.11]) (authenticated bits=0) by terra.edvax.de (8.17.1/8.17.1) with ESMTPA id 3BILCMNY049177; Mon, 18 Dec 2023 22:12:22 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Mon, 18 Dec 2023 22:12:17 +0100 From: Polytropon To: Jop Cc: "freebsd-questions@freebsd.org" Subject: Re: "The installed loader is a binary, not a filesystem, so even minor changes require recompiling." -George W. Lucas in Absolute fBSD Message-Id: <20231218221217.31246738.freebsd@edvax.de> In-Reply-To: References: Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:pwKVVl4VWC89m/E4eJy+o44gMkHSS4ACM9O85+zWizUzEWHHoOI QMSW2CDIv4fZEdpz7BF3ZKJ9CQBbKEXKEYkoUM+TvYo5ZRB1URzyvuQq0a9H0rEDTZzdaid XIvByx4JJaNxVHQVddNkbk9HVojMVlGJVjwjnzlvlaLHRVentrji3lxTj/j1htU3ajF16/T 2Ww3rTGNweYEDRX3uEFZQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:UVMHeSrXjvQ=;sOzdvkwpEXnrleCHXUemUiJT7OI rmsVf8L0pPvcrMQif4UCFX+Z6ymkLSG4NAbpdmJn0+pS5qEtlQYzLuMobz3qT5/NiClVUQCl/ dYTIcL0gxa6c3eodmo/kmG+1DHnUb/TiMsFsKCD/owlmyv31LLAs0DqY+8pmHWuGUSAG88J1h nRuGi3mYKMUBWxmlyCxSNSmNSA4ldZAD+ba72XtM57Y/x6viS0JBMfsPwRALR2XGcJSE3Rio8 Fq+2jMbw/xv72LSPg+gK/N59p0cFhsFnl/ecWtFvRiA9oQXhtNfvnBH2Llia2yfFbnRNyIVMV N9a7AXWZQq52QWENYnzrDeld3tN95sjyg/0so4wSEEwSnDQK3sSEmw4rXeNVFawTLlH/zgeLM +9LRDbtUJ3GCqzhMTJAJJox7oetnNZ/Gy7YLlpFZxHh95HcTtyxn0+hletKVrb5bz2Ta3dYSv vgvfNWVpzEFg47CY3e2mimOhtkmpYVH1h3apEDZ8RUPaPEUguXTEBg413/iPI4HQYKvJb5Ft7 JWZPqrPu/enVltFnbHCnVXKwF2VTKNz/mcH5GtO9T9hWdDu24bcseIrmR0rtvDsrxxJYcaBf5 pUDAYx1e68VQdcRGKxGHtiG0U/IWNwNNhWK1veJvh3/AgGFQiVSWjBpNKrkAFHHu/Yr1SZ3vr fyDNEANaZKOQlTzNtZ6grketZqTW2uyWBSHJOwQgthscXUvi2OpTjrBFyTx1ulMRO1rJ2gQgs gnG/C4bvCteIl1OHsW8I3AYYYWxTjtXpI5mtSr7NUr0PWSdovrqaWN5DvFqlUguJU67lajJjV 2e/kr73P994h9ybHmkxMgSq21k7A+dckzVYmZP/gx/fHTVUu81xLQGBeG67mNoZORgkjWCHz5 0ePE/kstBYepABw== X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:8560, ipnet:217.72.192.0/20, country:DE] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4SvCFq2Bxtz3VXH On Mon, 18 Dec 2023 20:17:58 +0000, Jop wrote: > Though this aspect of his introduction to FreeBSD is not about > FreeBSD directly, it seems vital for me to understand this > correctly so that I can aptly understand FreeBSD as a sheer > operating system and how an operating system boots. You can find a nice description in the locally-available documentation provided by FreeBSD, in "man 8 boot". > I was confused about Lucas' description because he is implying > there are some conditions in which a bootloader can be an actual > filesystem. That is technically not correct - it can _reside_ in a filesystem. While in classic MBR booting, the mentioned 512 B block at a specific location is a binary - it will be executed by the BIOS -, in EFI booting the boot loader, also being a binary, has to reside on a FAT partition as a file. Note again: The MBR boot block is not a file, it exists outside of all and any partition. However, it is not that simple. :-) Normally, a boot loader boots one operating system. If it allows you to select which OS to boot, i. e., which partition transfer control to, it is often called a "boot manager", but also it is a 512 B block. In case of more advanced boot managers, this 512 B block boots a specific partition, often called the "boot partition", where the boot manager resides on, and that boot manager then again is a binary in a file system (as with EFI). Note that the concept of a file system is not tied to a partition on a storage device, it can also reside as a file system in memory, for example, by unpacking data from a file into memory. > This appears very illogical to me, as to me he seems > to be saying the loader itself should be something like > FAT32, UFS, or ZFS. A boot loader cannot be a file system. It can be stored on one, but that isn't a 1:1 relationship (read: "it depends"). > Though filesystems, if my understanding is correct, help > us organise our data, they do not themselves contain data > but rather offer an organised space for that data, like a > library with empty bookshelves that we are ourselves to fill. Again, technically they are data, called meta-data. It states where user data is actually stored, what access paths get you to that data, what attributes the data has and so on. What I really recommend is the article about UFS (FFS) by M. K. McKusick. > Hence, if that "library" does not contain a bit of data > (e.g. the bootloader) that tells the BIOS how to boot the > operating system, the operating system cannot boot. Correct - because there is no operating system (with just a file system existing). In BIOS booting, a partition that is marked active can be booted, which is what the BIOS does. It transfers control to a specific location in that partition and reads its content into memory to be executed. If that what is found there is not a boot loader, nothing will happen. It's like a freshly formatted FAT partition with the active bit set - it doesn't boot DOS (not that DOS, the other one), because there is no DOS on it (yet). On FreeBSD, the boot process involves several steps, but that also applies to Linux, where often the additional step of a boot manager is included (but typically not required). The first step transfers control to the active partition with the boot program, that in turn reads the kernel, which then boots, and constructs the requirements for the root file system to be mounted, from where execution continues, in order to run system services and startup programs, which is the task of the "init" program. On the system boot level, terms like "chain loading" or "second stage booting" are common to describe those mechanisms. As I said, "man 8 boot" contains a good overview on how things work on FreeBSD, with SEE ALSO for parts like BTX and boot0. > Hence, it is logically implied that the bootloader cannot > be called in itself a filesystem—not just sometimes under > some conditions, but ever. Yes. That is correct. > Now, one a second note, I am new to the FreeBSD community, > I have not before used mailing lists, and the FreeBSD forums > were down. I understand IT communities can be strict about > what and how things are communicated, and I hope i have done > right by sending this email. I hope that I have done sufficient > research by searching online, consulting the WiKi pages, the > mailing list archives, and of course Lucas' book. I hope that > my question is on-topic enough and that my beginner-level will > not stagnate the flow of your erudite communications. Should > I have not utilised this mailing list properly, kindly accept > my apologies and let me know. This mailing list is very friendly and polite, and you have not done anything wrong. At least from my point of view. I don't speak for anyone but myself, but allow me to welcome you to FreeBSD and its user question mailing list, which absolutely suits your inquiry. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...