8 ms·
Future of 32-bit platform support in FreeBSD
- rwmj 3y agoFedora has been slowly removing i686: https://fedoraproject.org/wiki/Changes/Stop_Building_i686_Kernels https://fedoraproject.org/wiki/Changes/Stop_Building_i686_Ke... https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemo... There's still some 32 bit software (usually proprietary stuff, and/or libraries used by Wine). Removing 32 bit libraries especially just breaks this software and you don't really have any option except to get the vendor to fix it. But more importantly I sometimes find 64 bit assumptions in code. One recent example was in this new package that we're trying to add to Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=2263333 https://bugzilla.redhat.com/show_bug.cgi?id=2263333 It doesn't compile on i686 with some obvious compile issues. Upstream isn't particularly interested in fixing them. Typically the issues are incorrect assumptions about the size of 'long' and 'size_t'. And incorrect casts from pointers to longs (instead of using uintptr_t). Does any of this matter still or should we embrace this 64 bit only world? Will CPU makers remove i686 support? I guess we're going to find out.
- CJefferson 3y agoIt's increasingly hard to test 32 bits -- I run a modern Ubuntu, they don't even provide 32 bits versions of most libraries any more, so I have to wonder why it's worth putting significant hours I to supporting 32bits, when it's unclear if there are even any users.
- rwmj 3y agoI keep a very old Fedora VM around for this. Not ideal.
- torstenvl 3y agoHow about effort to remove undefined behavior based on non-portable assumptions? No code should cast a pointer to a `long`, ever. Trying to excuse it it with "we don't support 32-bit" is deeply wrong. EDIT: Apparently this position is unpopular. I am curious why people feel differently.
- CJefferson 3y agoWell, yes, I'd like to do that, but programmers make mistakes and it isn't easy to test. Also, you can't reasonably remove all undefined behaviour. In C++ you basically can't do file IO without undefined behaviour.
- knorker 3y agoAs a fellow UB nitpicker, I'd like to hear more about your favorite UB triggers. E.g. in the space of file IO.
- CJefferson 3y agoThe C++ filesystem section contains the following, which basically means you can’t do safe IO when other programs are running in the same computer: “ The behavior is undefined if the calls to functions in this library introduce a file system race, that is, when multiple threads, processes, or computers interleave access and modification to the same object in a file system.”
- torstenvl 3y agoI'm not sure that means much, since that's true of literally every language that does file I/O.
- mark_undoio 3y agoOn GCC , as far as I know, pointers will always cast to long and back ok. I'd expect the same from clang. No, that's not a portable behaviour but I can see that it's valid if you're targeting Linux. uintptr_t is more polite, though.
- a1o 3y agoI agree with you, we have appropriate types now, so we don't need to use long anymore - long also has different assumptions in Windows x64 builds vs equivalent regular Linux x64 (see also LLP64 vs LP64 vs ILP64)
- 3y ago
- ndiddy 3y agoUbuntu dropped 32-bit support several years ago. AFAIK they only support the 32-bit libraries required by Steam and Wine.
- jsheard 3y ago> Does any of this matter still or should we embrace this 64 bit only world? Will CPU makers remove i686 support? I guess we're going to find out. We're already on this path, Intel has proposed an "X86-S" subset which drops support for booting into 16/32-bit modes (though 32-bit applications would still be supported under a 64-bit OS), ARM Cortex-A cores already dropped support for 32-bit boot a few years ago and the latest ones are also dropping support for 32-bit applications, so the whole stack has to be 64-bit. Apple preemptively killed 32-bit apps even on hardware that could technically still support them, and their current hardware doesn't support 32-bit at all, not even in Rosetta.
- my123 3y agoRosetta supports 32-bit code execution via a very basic (segment-level) facility, designed for use by Wine.
- jsheard 3y agoTIL. I'm surprised they went out of their way to accomodate emulating 32-bit Windows apps, when they cut off 32-bit Mac apps completely.
- plorkyeran 3y agoDropping 32-bit macOS apps let them drop the second copy of every system library, and possibly even more importantly, support for the old obj-c runtime that was weird and different from the runtime used on every other platform. Supporting 32-bit wine is a much smaller burden.
- MBCook 3y agoWhich is especially useful on phones that are much more memory constrained than desktops.
- zahllos 3y agoFor the modern server/desktop and even laptop, that's also no bad thing. It is somewhat ridiculous that UEFI bioses, internally, still boot in 16-bit real mode and have to do all the steps your bios bootloader used to do to set up a 64-bit environment ready to go: https://github.com/tianocore/edk2/blob/edc6681206c1a8791981a2f911d2fb8b3d2f5768/UefiCpuPkg/ResetVector/Vtf0/Ia16/ResetVectorVtf0.asm https://github.com/tianocore/edk2/blob/edc6681206c1a8791981a..., https://github.com/tianocore/edk2/blob/edc6681206c1a8791981a2f911d2fb8b3d2f5768/UefiCpuPkg/ResetVector/Vtf0/Ia16/Real16ToFlat32.asm https://github.com/tianocore/edk2/blob/edc6681206c1a8791981a..., https://github.com/tianocore/edk2/blob/edc6681206c1a8791981a2f911d2fb8b3d2f5768/UefiCpuPkg/ResetVector/Vtf0/Ia32/Flat32ToFlat64.asm https://github.com/tianocore/edk2/blob/edc6681206c1a8791981a... Why not just start the CPU in "long mode", which is what everyone is using it for, in the first place? These newer ARM processors support 32-bit code at EL0 only (userspace). That seems like a reasonable approach for x86 as well and the freebsd announcement has this to say: > There is currently no plan to remove support for 32-bit binaries on 64-bit kernels. So for the moment, you can run 32-bit applications just fine.
- dooglius 3y agoI thought the Linux kernel enforces/requires a pointer to fit into a long, so any platform with Linux will define long type as appropriately sized?
- DinoCoder99 3y agoI'd much prefer C users not use long at all. What's wrong with size_t and uint32_t and uint64_t?
- UncleEntity 3y ago> What's wrong with size_t and uint32_t and uint64_t? An extra #include and more typing? Plus, all the C89 users are out of luck...
- int_19h 3y agoIt's trivial to roll your own basic <stdint.h> with those types for existing C89 implementations. Unless they don't provide the corresponding type natively at all (which can be the case for some 16-bit platforms and 64-bit). But then you have a bigger problem anyway.
- legulere 3y agoOnly with effort Linux was able to be ported to Clang. All compilers that compile Linux should also be able to deal with size_t and consorts.
- deleted 3y ago[deleted]
- cesarb 3y ago> And incorrect casts from pointers to longs (instead of using uintptr_t). That's not an issue on mainstream Linux, since uintptr_t and long always have the same size, both on 32-bit and on 64-bit. It's an issue only when using some new experimental stuff which uses two machine words per pointer, or when trying to port to Windows (where long is always 32-bit even when compiling for 64-bit).
- Brian_K_White 3y agoAt one point 16 bits were universal, and then 32 bits came along and broke everything. We learned some lessons that day. Then 32 bits was universal for a while and 64 bits came along and broke everything. I guess we forgot those lessons, but OK well at least we learned them again for real this time. What a relief it is that we have reached the final architecture and will never have to worry about anything like that again!
- cesarb 3y ago> At one point 16 bits were universal, and then 32 bits came along and broke everything. That's not an issue in mainstream Linux, since 16-bit Linux (ELKS) never caught on. Other than ELKS and perhaps some new experimental stuff, since its first release Linux always had long and pointer with the same size.
- arp242 3y agoAt some point in history a "byte" could also be considered to mean any number of things. There was great value in standardizing on 8 bits. The there is of course no clean separation between the two, but by many definitions the "64-bit era" has already lasted longer than the "32-bit era". The real lesson from history is that we moved for specific practical reasons, and that these reasons don't exist with 64-bit architectures today. 64-bit is and most likely will remain the standard size for the foreseeable future. I predict that even embedded will (slowly) move to 64-bit because again, there is great value in standardizing these types of things.
- int_19h 3y ago
- cesarb 3y ago> There's still some 32 bit software (usually proprietary stuff, and/or libraries used by Wine). Wine is going to stop being an issue somewhat soon. The Wine developers are adapting it to work more like Windows, by making even 32-bit applications call the 64-bit libraries. I expect that, not long after Wine switches to always using 64-bit libraries, distributions (probably starting with faster-moving ones like Fedora) will completely (or almost completely, leaving only glibc and its dependencies) drop the 32-bit libraries. And we're already close to the Y2038 deadline, which gives distributions another incentive to drop 32-bit libraries (instead of having to go through a migration to the 64-bit time API, similar to the migration to 64-bit file offsets we had some time ago).
- zozbot234 3y agoDebian is moving their 32-bit releases to 64-bit time, it's a big transition but it's expected to be ready for the next release. But they've also announced that they may be forced to drop their i686 release quite soon.
- SomeoneFromCA 3y agoFreebsd is sponsored by those who only in concerned about its server performance, and 32-bits are not there anymore.
- pjmlp 3y agoIn a way this makes sense UNIX was born as server OS, that is still its strong point, and what usually gets discussed on USENIX.
- sitkack 3y agoI am slightly concerned with running embedded Unix software if 32-bit is going away so fast.
- leonheld 3y agoWhy? We build everything from source anyway, and armhf compilers are not going away any time soon.
- jonhohle 3y agoBuilding from source doesn’t matter if platform support code is no longer in the OS source tree.
- adrian_b 3y agoFor open-source operating systems there will always remain the older stable 32-bit releases like FreeBSD 16 in this case. Even if there still are plenty of obsolete 32-bit CPUs running Linux or *BSD, since many years I have never seen a case where using them is the right technical choice. When a UNIX-like OS is desired, it is a mistake to use anything less than a very cheap 64-bit CPU, like one with ARM Cortex-A55 cores. For the many embedded applications where a 32-bit CPU is appropriate, either one of the many open-source RTOSes should be used or a bare-metal program, which is the best choice in many cases. For such embedded applications, a UNIX-like OS is much too bloated and it does not allow deterministic control of the hardware.
- galangalalgol 3y agoThere os an in between space like the RPi zero where you can drop rt linux kernel (and rt modules). 32bit embedded linux is still really quite widespread. I expect risc-v to breath some new life into it as well. Sometimes a lack of hard (or any) real time requirements, combines with price and occasionally power (where I expect risc-v to come in) to allow for embedded linux. It usually requires less development time too. Think how many home routers, and security systems are still built off of 32bit linux. I don't know any built off of freebsd though, so maybe a good call?
- anthk 3y ago[flagged]
- bluGill 3y agoThose old machines use so much more energy (CO2) to do the same work that we are environmentally ahead in a year trashing them. Of course newer machines often use more energy because of bloated software, but assuming you run the same software newer machines are much more energy efficient.
- wazoox 3y agoIn many places, 90% and up of a computer environmental footprint is its fabrication. In France, Canada etc using a computer as long as possible is the right choice from an environmental standpoint. Of course even 10, 12 and 15 year-old computers are generally 64 bits now (my home server is of 2007 vintage).
- zozbot234 3y agoDepends on the machine. Big desktop systems and servers yes, but early Atom-based netbooks/"nettops" are 32-bit based and could still be useful as thin clients or for very light office work. You won't want to run a modern web browser on them though.
- anthk 3y agoIf you use a light environment, a CPU throttler such as cpufreq and software like Dillo, Sylpheed, Pidgin... the power usage will be perfecly down. For general news there is http://68k.news http://68k.news, gopher://magical.fish... and several others such as https://text.npr.org https://text.npr.org. For gaming, people would like Minetest or some light games at least once a week to disconnect from some AAA games. The setup wouldn't be as fancy as a modern machine with FFox/Chrom* and Steam, but fore sure it will be useful and gamers would discover crazy gaming mechanics not seen anywhere else, such as Cataclysm DDA:Bright Nights. As they state in the thread, creating a new computer it's far more wasteful.
- nolist_policy 3y ago
- throw0101c 3y agoSomewhat related: > time_t is 8 bytes on all supported architectures except i386. * https://man.freebsd.org/cgi/man.cgi?arch https://man.freebsd.org/cgi/man.cgi?arch * https://en.wikipedia.org/wiki/Year_2038_problem#Implemented_solutions https://en.wikipedia.org/wiki/Year_2038_problem#Implemented_...
- jmclnx 3y agoOpenBSD may be looking at the same: https://www.openbsd.org/i386.html https://www.openbsd.org/i386.html Luckily NetBSD still exists, I very much doubt they will depreciate 32 bit: https://www.netbsd.org/ports/i386/hardware.html https://www.netbsd.org/ports/i386/hardware.html NetBSD to me is a cool system, doing some unique things. But, sadly they need more support than they get these days.
- SomeoneFromCA 3y agoYes NetBSD has nice chill vibe to it, neither Free nor Open has. But packages are less fresh, and lots of things are not supported.
- hiAndrewQuinn 3y agoThis is probably a good sign for anyone out there interested into getting into a long tail niche industry, similar to how COBOL lives on in banking. There are probably going to be places we'd never expect running 32-bit applications for decades to come (I'm thinking industrial automation shops and the like), and getting in on the ground floor of developing for NetBSD would be a high-powered signal that you are interested in helping support these ancient machines. (Do I recommend this myself? Well, I think techies find all kinds of weird things fun. :))
- accrual 3y ago> OpenBSD may be looking at the same Is that in reference to this line? > Due to the increased usage of OpenBSD/amd64, as well as the age and practicality of most i386 hardware, only easy and critical security fixes are backported to i386. The project has more important things to focus on. This has been on the i386 page for quite a while. I haven't specifically heard of the developers dropping i386, but I also don't follow the mailing lists as much as I used to. I really hope OpenBSD doesn't drop i386 as it's my go-to operating system for a lot of otherwise not very useful hardware - retro PCs, 32-bit laptops, etc. One can take any bog standard Pentium or higher box and turn it into a usable machine with OpenBSD.
- tyfon 3y ago
- effnorwood 3y ago[dead]
- faefox 3y agoThis makes me feel old.