OSDev.org
https://forum.osdev.org/

Bare Bones and Meaty Skeleton cleanup
https://forum.osdev.org/viewtopic.php?f=8&t=36311
Page 1 of 1

Author:  Schol-R-LEA [ Wed Nov 27, 2019 9:33 am ]
Post subject:  Bare Bones and Meaty Skeleton cleanup

In a recent thread, JAAman claimed that the current x86 Bare Bones and Meaty Skeleton examples would no longer work as intended on a current-gen UEFI x86 system, and that they should be deprecated in favor of the UEFI Bare Bones, and re-wrting the latter to be more stand-alone. The discussion was specifically about support for text mode on systems which do not have CSM, and frankly I don't know of the accuracy of JAAman's assertions, but I thought it better to move the conversation here.

Assuming JAAman's assertion has merit (I expect it does, as it fits with what little I know about it), how should we proceed with cleaning this up?

Author:  iansjack [ Wed Nov 27, 2019 1:09 pm ]
Post subject:  Re: Bare Bones and Meaty Skeleton cleanup

I'm not convinced that anything needs to be "cleaned up". Many, if not most, people here will be working with emulators and/or older machines for which the existing skeleton projects are entirely appropriate. By all means write complementary articles detailing development for UEFI machines, but let's not sweep the older stuff under the carpet.

Author:  Octocontrabass [ Thu Nov 28, 2019 6:23 am ]
Post subject:  Re: Bare Bones and Meaty Skeleton cleanup

I think it would be a good idea to add a warning that the example assumes legacy hardware and won't work correctly (if at all) when booted on a modern UEFI computer.

It would also be possible to rework them to use a LFB instead of assuming VGA text mode. This way, the same example would run regardless of the underlying firmware.

Author:  thomtl [ Thu Nov 28, 2019 9:44 am ]
Post subject:  Re: Bare Bones and Meaty Skeleton cleanup

You could add a note saying that if your system is UEFI you need to enable CSM and boot it in that mode. I don't see any reason for it not working on CSM(apart from buggy firmware but thats not the point).

Author:  Schol-R-LEA [ Thu Nov 28, 2019 12:35 pm ]
Post subject:  Re: Bare Bones and Meaty Skeleton cleanup

thomtl wrote:
You could add a note saying that if your system is UEFI you need to enable CSM and boot it in that mode. I don't see any reason for it not working on CSM(apart from buggy firmware but thats not the point).


The specific claim by JAAman was that newer CPUs - the Pentium Gold series in particular - don't support CSM at all:

JAAman wrote:
I don't believe there is any such thing as a "Pentium Gold" system which supports CSM


This seems a bit premature, but I don't know for certain. Yes, Intel has removal of CSM on their 2020 roadmap, but I don't know if they've actually removed it from any of the current chipsets or not, and I don't think that they had announced that intent in early 2017 (which is when the 4415U model CPUs came out, according to Intel's own page on them; note that it was originally branded as just Pentium, and the Pentium Gold label was a change made later that year, according to Wicked-Pedo). Neither Wikipedia's page on Kaby Lake processors nor WikiChip's page on the 4415U specifically mention removal of CSM, but that in itself means little.

While the point that newer chipsets won't support CSM soon is a valid one (and one I have made often enough myself), AFAICT most of the existing ones still do.

While I agree that the wiki should encourage a move to UEFI and post-CSM approaches to video modesetting (using the LFB, rendered fonts rather than text mode, etc.), I felt that it was something that needed to be discussed before any changes were made.

Author:  thomtl [ Thu Nov 28, 2019 1:50 pm ]
Post subject:  Re: Bare Bones and Meaty Skeleton cleanup

AFAIK Intel NUCs already don't support CSM, however IMHO the wiki should first try to open up more to x86_64 before we go to UEFI. Currently everything on the wiki is assuming 32bit Protected mode and painting 64bit long mode as some impossible hurdle, while that is far from true. Since all UEFI pcs these days drop you off in 64bit long mode(afaik only a few obscure systems ever had 32bit pmode).

Author:  eekee [ Tue Dec 10, 2019 5:04 am ]
Post subject:  Re: Bare Bones and Meaty Skeleton cleanup

I wrote a post for the other thread before I saw the link to this one, (good idea, Schol,) posting it here as more appropriate. Quotes are from the other thread. My biggest beef with obsoleting the old stuff is, sooner or later, we are going to get hobbyists with new or new-ish BIOS-based hardware designed for hobbyists. Also, my primary dev box is borderline for UEFI; a laptop of a type launched in 2007. And Bochs... does it still not support UEFI, or is our wiki info outdated?

At the same time, I would appreciate more and clearer UEFI info; I'm thinking of actually using it myself. I did not, for instance, know that almost all UEFI machines boot to 64-bit mode until I read thomtl's comment just now. I didn't even know 2007 was a transition year until I read JAAman's comments in the other thread.


JAAman wrote:
unfortunately, that meaty skeleton tutorial is designed for computers from the 1980s, and will not work on anything but emulators today -- that computer is far too modern for the meaty skeleton tutorial to work on it

the meaty skeleton tutorial (and all the barebones ones too) should probably be removed from the wiki (or at least moved to an "old deprecated information" subsection)

That's too strong, there are BIOS-based devices still being produced. Some new devices were released last year for industry and hobbyists. Outside those fields, BIOS and legacy hardware support is only just now starting to go away. The key is knowing the difference between BIOS & legacy hardware on the one hand, and UEFI on the other. Perhaps a note should be added to the BIOS-based tutorials, perhaps the converse of this:

JAAman wrote:
using UEFI, your code should work on all computers since 2012, most computers since 2007, and almost all emulators but will not work on most computers older than 2007


Perhaps the first page should be something like, "Know the difference between BIOS & UEFI".

Author:  thomtl [ Tue Dec 10, 2019 8:57 am ]
Post subject:  Re: Bare Bones and Meaty Skeleton cleanup

Quote:
And Bochs... does it still not support UEFI, or is our wiki info outdated?

Bochs doesn't last time i checked, QEMU does though. And so do VMWare, VirtualBox probably too

Author:  Octocontrabass [ Tue Dec 10, 2019 9:47 am ]
Post subject:  Re: Bare Bones and Meaty Skeleton cleanup

Bochs supports UEFI well enough to boot an operating system.

Author:  thomtl [ Tue Dec 10, 2019 9:52 am ]
Post subject:  Re: Bare Bones and Meaty Skeleton cleanup

Huh TIL, my bad

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/