News for hackers. Stuff that matters.
Re:I work in DOS for a day (2014) by myth_drannon on Tuesday July 06, 2021 @12:57PM (#27751209)
Golang in DOS! "...and it was updated in March 2012 to include the Go programming language in addition to C, C++, and Fortran. "

I wouldn't mind having Rust on 486 but it doesn't look like it will ever be possible from what I read about its architecture.

Re:I work in DOS for a day (2014) by mmastrac on Tuesday July 06, 2021 @01:22PM (#27751572)
Rust can link 32-bit code that can run 16-bit segmented mode [0] and if you can figure out the right set of protected mode magick, you could almost certainly get it working in flat mode.

I started working on a DOS-based project and played around with Rust before deciding that it was going to be tough and would not be as optimal as just dropping to C and using OpenWatcom which is pretty capable considering its age, IMO.

[0] https://github.com/o8vm/rust_dos

Re:I work in DOS for a day (2014) by Teknoman117 on Tuesday July 06, 2021 @01:10PM (#27751401)
I managed to compile for a 386 as a target for a no_std rust, but as far as running the compiler goes, might be SOL on that one.

https://github.com/teknoman117/ts-3100-images/tree/master/ru...

(for this SBC: https://docs.embeddedarm.com/TS-3100)

My goal was to follow blog_os on this board for fun. Main sticky point is the 386 not having any hardware atomic operations (which didn't show up until 486).

I recently got a current Gentoo base environment booting on a 133 MHz AM5x86 based industrial SBC and it takes 3 minutes to compile hello world in C++ (70 seconds for C) so I'm not super confident you'd even want to use rust compiler on a 486, even for "a day in a programmer's life from 30 years ago" experiment.

Re:I work in DOS for a day (2014) by mmastrac on Tuesday July 06, 2021 @02:38PM (#27752589)
Technically, as a single-core CPU, all operations are atomic. /s
Re:I work in DOS for a day (2014) by Teknoman117 on Tuesday July 06, 2021 @04:30PM (#27753841)
I suppose I should say instructions which let you do critical sections without disabling preemption or interrupts =P
Re:I work in DOS for a day (2014) by mmastrac on Tuesday July 06, 2021 @05:30PM (#27754548)
Hah yes. I got used to the CLI/STI pattern around perf-sensitive or concurrent code on <=386 back in the day.

EDIT: though I wonder now if you could use the fact that flags are returned from basic memory ALU operations to implement some basic atomics.