From nobody Mon Dec 18 20:50:21 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 4SvBmW2b2gz53pW7 for ; Mon, 18 Dec 2023 20:50:35 +0000 (UTC) (envelope-from pprocacci@gmail.com) Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SvBmV70Fzz4ZlT for ; Mon, 18 Dec 2023 20:50:34 +0000 (UTC) (envelope-from pprocacci@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5537ee0c4aaso962015a12.0 for ; Mon, 18 Dec 2023 12:50:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702932631; x=1703537431; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=B6PMFGfkNeKCxVVzTNzyn4cxD6zIg3wXz68HkcZRm7A=; b=XgAXT/x1E36Q2K9l5EO38gj4UvRs/zW3qHD17cdebqMl5ESoW3aFxexjiosZWor1Yo H01JKfGKZDYbKRowLwKxuvsu8yo6rhIgsdOqw3GyeSyyeK0apQHi3EMhpNXqXWD17zJ/ dHMnehjhbMr8v1tktsINdwBh8oNfBNZnCyk3nKNY6wr+bfGUftzjac+YIDkUPEUOoDHj 3oMrhWeJExUswPkBV4XTafn5OoumydwsqpHFtrBdeB4ojaug+zhxe62OtXCwmo/Kllx4 EHe5zQ/Lh6CMby01GuCiniwysxdCBvT+PbYl0G3IGxzLmwrwK4ZACkv+hTIDyJmNHSvw 10oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702932631; x=1703537431; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=B6PMFGfkNeKCxVVzTNzyn4cxD6zIg3wXz68HkcZRm7A=; b=bl/2pTRL+KKW1McQw0cgGvE9eB41WKSUqWKYnjvC0mt88TW+alPWzWj7wbIFf131rA agZ/2oXYQCdZ+20RzRpY37xD+tAvSiYdm8D0gUzAlfSXWnq5c9TxnSs1l51fGtfd6OSR qIuUIhxcSJA3OTpsyKbeckc0F5W4hEwSj96xeZIh7bMsq4kD0D4RZocQNzyrrDBh7RUc fJI0SGALEs8fUu7AuYjRTaqULI8aOX6It63kCumxfw3zV1Vjiq2HPIqxxAYsghJUVCYv P3taU3FfTREGiuXYC3LbtqN7VjCYxD5/B8XlKAfxGPvlU2GelX3Pk+EnDcOI+pd2aeDO e4SQ== X-Gm-Message-State: AOJu0YwXEyKvJCbtNioIl2E23ygFPTFtyJRYRVn7tq+YvI3BnKRqAJOI PdzWfoX1pxZgtkxri/50iatLyp2+/1wQwVkf/XDFZxtZFQ== X-Google-Smtp-Source: AGHT+IHzP/X10GRzMnEDSE9zCqURy6AYCdU71avaTQJGBLy4y4BIhY9v0O3vkpbFaxBWVzS/7x3k+S1kCiI/ErRE5YI= X-Received: by 2002:a50:d755:0:b0:553:82de:b01 with SMTP id i21-20020a50d755000000b0055382de0b01mr342728edj.22.1702932630560; Mon, 18 Dec 2023 12:50:30 -0800 (PST) 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 References: In-Reply-To: From: Paul Procacci Date: Mon, 18 Dec 2023 15:50:21 -0500 Message-ID: Subject: Re: "The installed loader is a binary, not a filesystem, so even minor changes require recompiling." -George W. Lucas in Absolute fBSD To: Jop Cc: "freebsd-questions@freebsd.org" Content-Type: multipart/alternative; boundary="00000000000085656a060ccee60a" 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:15169, ipnet:2a00:1450::/32, country:US] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4SvBmV70Fzz4ZlT --00000000000085656a060ccee60a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Dec 18, 2023 at 3:19=E2=80=AFPM Jop wrote: > Hello everyone, > > I have just begun my journey into FreeBSD using George W. Lucas' *Absolut= e > FreeBSD *3rd edition*.* My question is about *chapter 4* *Start Me Up! > The Boot Process,* page 51. > I was befuddled by a statement he made, likely due to my IT nescience. > To my confusion, Lucas states: > > > A BIOS has all sorts of limitations. The boot loader must reside in a v= ery > specific section of the disk. BIOS can=E2=80=99t boot from disks larger t= han 2.2TB. > The target boot loader must be smaller than 512KB=E2=80=94huge by 1980 > >standards, yes, but paltry today. :::*The installed loader is a binary, > not a filesystem, so even minor changes require recompiling *:::*.* > > > 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 ca= n > aptly understand FreeBSD as a sheer operating system and how an operating > system boots. I was confused about Lucas' description because he is > implying there are *some *conditions in which a bootloader can be an > actual *filesystem*. This appears very illogical to me, as to me he seems > to be saying the loader itself should be something like FAT32, UFS, or ZF= S. > Though filesystems, if my understanding is correct, help us *organise *ou= r > 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. Hence, if that "library" does not contain a bit of dat= a > (e.g. the bootloader) that tells the BIOS how to boot the operating syste= m, > the operating system cannot boot. Hence, it is logically implied that the > bootloader cannot be called in itself a filesystem=E2=80=94not just *some= times *under > some conditions, but *ever*. > As I trust Lucas' expertise, how have I misread him? What is he actually > trying to say? > > I have searched online, and read a Wiki on bootloaders > and filesystems > , only to have my asinine > interpretation confirmed. > > 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 do= ne > 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. > > Sincerely, > > *J.* > Your comment is well written. I'm afraid my response will fail in any attempt to be as articulate as you. -- Sorry in advance. BIOS understands one thing; that is where to find an initial binary blob (or MBR). The binary that gets placed into that MBR we call a stage0 bootloader. That MBR must exist for all operating systems in the same place; it's how BIOS hands off control to an actual kernel. The MBR doesn't live within any filesystem. It's the first sector / first block of a given boot disk, is always the same size and will always be loaded into memory and executed as the first "task" BIOS does. In the world of FreeBSD even though there can only ever be one MBR on a given disk, that data that's stored within the MBR, can be exploited to read other sectors off of a disk which could in turn load basic file system functionality. You can imagine once basic file system functionality is loaded, at that point it's just a matter of calling the necessary bits to load other parts of your loader. FreeBSD differentiates these different stages as: stage0, stage1 ..., etc. stage0 being more or less what I described above; it's the entrypoint for BIOS. stage1 and onward dealing with basic filesystem functionality (at least initially) and then going from there. When I refer to the term `bootloader', I generally use it in the context of `stage0', though truthfully it could mean the entire process. ~Paul --=20 __________________ :(){ :|:& };: --00000000000085656a060ccee60a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Mon, Dec 18, 2023 at 3:1= 9=E2=80=AFPM Jop <redc3ll@prot= onmail.com> wrote:
Hello= everyone,
=
I have= just begun my journey into FreeBSD using George W. Lucas' Absolute = FreeBSD 3rd edition.=C2=A0My question is about chapter 4 = Start Me Up! The Boot Process,=C2=A0page 51.
I was befuddled by a= statement he made, likely due to my IT nescience.
To my confusion, Luca= s states:=C2=A0

<= blockquote style=3D"border-left:3px solid rgb(200,200,200);border-color:rgb= (200,200,200);padding-left:10px;color:rgb(102,102,102)">>=C2=A0A B= IOS has all sorts of limitations. The boot loader must reside in a=C2=A0very specific section of the disk. BIOS can=E2=80=99t boot from disks l= arger than 2.2TB. The target boot loader must be smaller than 512KB=E2=80= =94huge by 1980
>standards, yes, but paltry today. :::The = installed loader is a binary, not a filesystem, so even minor changes requi= re recompiling :::.=C2=A0

Though = this aspect of his introduction to FreeBSD is not about FreeBSD directly, i= t seems vital for me to understand this correctly so that I can aptly under= stand FreeBSD as a sheer operating system and how an operating system boots= . I was confused about Lucas' description because he is implying there = are some conditions in which a bootloader can be an actual filesy= stem. 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. Though file= systems, if my understanding is correct, help us organise our data, = they do not themselves contain data but rather offer an organised sp= ace for that data, like a library with empty bookshelves that we are= ourselves to fill. Hence, if that "library" does not contain a b= it of data (e.g. the bootloader) that tells the BIOS how to boot the operat= ing system, the operating system cannot boot. Hence, it is logically implie= d that the bootloader cannot be called in itself a filesystem=E2=80= =94not just sometimes under some conditions, but ever.=
As I trust Lucas' expertise, how have I misread him? What is he act= ually trying to say?

I have searched online, and read a Wiki on bootloaders and filesystems, only t= o have my asinine interpretation confirmed.

Now, o= ne 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 communiti= es can be strict about what and how things are communicated, and I hope i h= ave done right by sending this email. I hope that I have done sufficient re= search by searching online, consulting the WiKi pages, the mailing list arc= hives, and of course Lucas' book. I hope that my question is on-topic e= nough and that my beginner-level will not stagnate the flow of your erudite= communications. Should I have not utilised this mailing list properly, kin= dly accept my apologies and let me know.

Sincerely= ,

J.

Your comment is well written.=C2= =A0 I'm afraid my response will fail in any attempt to be as articulate= as you.=C2=A0 -- Sorry in advance.

BIOS understands one = thing; that is where to find an initial binary blob (or MBR).=C2=A0 The bin= ary that gets placed into that MBR we call a stage0 bootloader.=C2=A0 That = MBR must exist for all operating systems in the same place; it's how BI= OS hands off control to an actual kernel.
The MBR doesn't= live within any filesystem.=C2=A0 It's the first sector / first block = of a given boot disk, is always the same size and will always be loaded int= o memory and executed as the first "task" BIOS does.

In the world of FreeBSD even though there can only ever be one MBR on= a given disk, that data that's stored within the MBR, can be exploited= to read other sectors off of a disk which could in turn load basic file sy= stem functionality.
You can imagine once basic file system fu= nctionality is loaded, at that point it's just a matter of calling the = necessary bits to load other parts of your loader.

FreeBS= D differentiates these different stages as: stage0, stage1 ..., etc.

stage0 being more or less what I described above; it= 's the entrypoint for BIOS.
stage1 and onward dealing wit= h basic filesystem functionality (at least initially) and then going from t= here.

When I refer to the term `bootloader', I genera= lly use it in the context of `stage0', though truthfully it could mean = the entire process.

~Paul
--
__________________

:(){ :|:& };:
--00000000000085656a060ccee60a--