« Back80386 Protectionnand2mario.github.ioSubmitted by nand2mario 3 days ago
  • dsign 4 hours ago

    I've wondered for a long time if we would have been able to make do without protected mode (or hardware protection in general) if user code was verified/compiled at load, e.g. the way the JVM or .NET do it...Could the shift on transistor budget have been used to offset any performance losses?

    • st_goliath 4 hours ago

      Microsoft Research had an experimental OS project at one point that does just that with everything running in ring 0 in the same address space:

      https://en.wikipedia.org/wiki/Singularity_(operating_system)

      Managed code, the properties of their C# derived programming language, static analysis and verification were used rather than hardware exception handling.

      • alnwlsn 13 minutes ago

        I think TempleOS also worked like this, though its certainly better known for its "other" features.

        edit: I missed it was linked on the above page

        • avadodin 3 hours ago

          Fil-C vs CHERI vs SeL4 vs YOLO

          I think hardware protection is usually easier to sell but it isn't when it is slower or more expensive than the alternative.

          • Joker_vD an hour ago

            "Operating System Principles" (1973) by Per Brinch Hansen. A full microkernel OS (remake of RC-4000 from 1967) written in a concurrent dialect of Pascal, that also manages to make do without hardware protection support.

        • rwmj 2 hours ago

          I think the interesting thing about having protection in software is you can do things differently, and possibly better. Computers of yesteryear had protection at the individual object level (eg https://en.wikipedia.org/wiki/Burroughs_Large_Systems). This was too expensive to do in 1970s hardware and so performance sucked. Maybe it could be done in software better with more modern optimizing compilers and perhaps a few bits of hardware acceleration here and there? There's definitely an interesting research project to be done.

          • ttflee 2 hours ago
          • inigyou 3 hours ago

            Interesting to see how hardware designers of yesteryear did things, and why CPUs are so complicated and have so many bugs.

            • 4j452j45nj 4 hours ago

              ah, PDE/PTE A/D writes... what a source of variety over the decades!

              some chips set them step by step, as shown in the article

              others only set them at them very end, together

              and then there are chips which follow the read-modify-write op with another read, to check if the RMW succeeded... which promptly causes them to hang hard when the page tables live in read-only memory i.e. ROM... fun fun fun!

              as for segmentation fun... think about CS always being writeable in real mode... even though the access rights only have a R but no W bit for it...

              • jejgkgkldl 6 hours ago

                Article states that win 3.0 used 32-bit flat addressing mode, but when win 95 launched ms said win 3.0 didn’t (in 386 mode).

                • shakna 6 hours ago

                  Pretty sure Enhanced Mode, that only came later in Windows 3.11 for Workgroup, is the one that supported the flat addressing mode.

                  • joakleaf 4 hours ago

                    Enhanced mode was already in 3.0 (and I think allowed for flat addressing)

                    However, Win32s was introduced in 3.11 which a subset of the Windows 32-bit API from NT.

                    3.11 also introduced 32-bit disk access and 32-bit drivers.

                    Microsoft did 32-bit in steps -- it was confusing already back then.

                    • dspillett an hour ago

                      > 3.11 also introduced 32-bit disk access and 32-bit drivers.

                      IIRC a lot of it wasn't turned on by default due to hardware/driver compatability concerns, and there were articles all over the place about how to turn it on for extra performance. Essentially they used optimising tech-heads the world over as a giant beta-test group for parts of Win95's IO subsystem.

                    • vasvir 5 hours ago

                      yep that's my recollection too

                    • this-is-why 5 hours ago

                      It used segmented 32-bit mode. Flat mode doesn’t support virtual addressing which was accomplished with the descriptor tables (and the ES register) if I recall correctly. lol it’s been 33 years since I wrote windows drivers. Had to use masm to compile the 16-bit segments to thunk to the kernel

                    • fortran77 3 hours ago

                      > These features made possible Windows 3.0, OS/2, and early Linux.

                      And also--before Linux--SCO Xenix and then SCO Unix. It was finally possible to run a real Unix on a desktop or home PC. A real game changer. I paid big $$$ (for me at the time) to get SCO Xenix for my 386 so I could have my own Unix system.

                      • icanhasjonas 7 hours ago

                        Made me think of the old Desqview