8 ms·
Consider using Digital Mars C compiler
- yuhong 8y agoContext: The Open Watcom license has been a problem for years.
- deleted 8y ago[deleted]
- nanamo 8y agoCould you please expand more
- yuhong 8y agoI had an issue about the problems: https://github.com/open-watcom/open-watcom-v2/issues/271 https://github.com/open-watcom/open-watcom-v2/issues/271
- cjensen 8y agoSo there's a theoretical problem, and a solution available. Why should VirtualBox take the pain now rather than waiting and seeing if the theoretical issue every materializes? I mean, if someone does the work and tests it, then sure, VirtualBox should adopt it. But why is this their problem to solve now?
- geofft 8y agoThere is a practical problem that VirtualBox is in Debian contrib and not main because it cannot be built with tools in Debian main. (Whether this is a practical problem that matters to anyone is a different question, but it's more than theoretical.)
- caf 8y agoI don't think DMC is in Debian main yet, is it?
- earenndil 8y agoWhy not just use gcc or clang?
- yuhong 8y agoProblem is that x86 segmentation support is lacking, which is important for things like the BIOS.
- geofft 8y agoFor certain ways of writing the BIOS - you can have the BIOS immediately enter 32/64-bit flat addressing mode (as if you were a 32/64-bit kernel) and then drop back to 16-bit mode when you're done if you need to do a legacy MBR boot. I think this is how coreboot/libreboot/linuxboot/etc. and Tianocore/EDK2 work. Can you use Tianocore as your BIOS for VirtualBox the way that you can use it (in the form of OVMF) for qemu? How is SeaBIOS built?
- yuhong 8y agoAnd even writing some 16-bit code using gcc is not impossible too. The problem is that it lacks support for things like near and far pointers.
- WalterBright 8y agoWithout near and far pointers, it is hopeless to write non-trivial programs for 16 bit DOS.
- yuhong 8y agoAnd even for things like BIOS they can be useful, and that is what I am most interested in.
- geofft 8y agoSure. My argument is that unless you're interested in retrocomputing (which is a cool field, but not the field VirtualBox is in) you shouldn't be writing non-trivial 16-bit programs at all any more - VirtualBox doesn't even support emulating any 16-bit-only CPUs. You should be writing 32-bit programs with a tiny bit of 16-bit code on each end (either in assembly or in trivial C) to switch from 16-bit to 32-bit mode and back. Since you only need the BIOS for a very small amount of time to support a bootloader loading itself, the slowness of switching modes at each interrupt will hardly be your limiting factor (especially given that you're in a VM). This has the advantage that you don't need any new compiler to build your program, neither OpenWatcom or Digital Mars. (Nothing against the Digital Mars compiler! I just think that it isn't the right engineering direction for VirtualBox to depend on retrocomputing.)
- WalterBright 8y agoI agree! https://www.digitalmars.com/download/freecompiler.html https://www.digitalmars.com/download/freecompiler.html
- WalterBright 8y agoI realized I had neglected to make the source to the runtime library available. Fixed that: https://github.com/DigitalMars/dmc/tree/master/src https://github.com/DigitalMars/dmc/tree/master/src Everything in it that is copyrighted Symantec or Digital Mars is now Boost licensed. In particular, stuff that is copyrighted by Microsoft is NOT Boost licensed and cannot be redistributed.
- thepumpkin1979 8y agoThis is going to sound like an stupid question but it could be just lack of marketting or lack of documentation but I'm reading through the website and it only mentions supports for Win32, Win16, DOS and DOS32, is this correct? I'm curious to know how is that going to work for VirtualBox given that I use it on my Mac. Is the ticket suggesting they switch from VisualC++ compiler to DMC?
- yuhong 8y agoIt would be for things like the BIOS you use to boot your VirtualBox VMs which has to be 16-bit real mode code. Hopefully the compiler itself runs on Linux already (though this is only needed for building the code).
- WalterBright 8y agoI don't know anything about VirtualBox. But DMC can generate 16 bit x86 code.
- geofft 8y agoThe ticket is suggesting that for building the BIOS that runs inside the VirtualBox image, they switch from OpenWatcom (another C compiler for DOS) to Digital Mars. VirtualBox emulates an IBM-compatible PC, and the traditional boot protocol for IBM-compatible PCs involves a BIOS that sets up the machine and provides a rudimentary runtime library for things like screen output or disk access. This BIOS is written for 16-bit x86, same as / binary-compatible with DOS, so any good compiler that can produce DOS object files can be made to work here too. (Most bootloaders / kernels will quickly switch to 32- or 64-bit mode, but they expect to be started in 16-bit mode and expect to make calls to the BIOS to load their own code.) This ticket is not about changing the compiler that builds VirtualBox itself.
- john_moscow 8y agoI am probably going to get downvoted for this, but let me try. I am assuming, this is related to VirtualBox using the OpenWatcom compiler [0] for BIOS because it is the only reasonable way to handle x86 segmentation from C. So this ticket is basically asking the VirtualBox maintainers to take a reliably working part of the product and to port it to a different compiler, retest everything, fix any bugs caused by differences between compilers and update the build process as well. So as an end user of VirtualBox, I would either notice no difference at all (BIOS isn't a performance bottleneck really), or will get a regression due to bugs. With all due respect to the free software community, I would say switching the compiler used in a stable product without an apparent improvement noticeable by the users would not serve their best interests. It is also a bit strange to see it not in a form of "hey, we really care about free software, so we ported this part to use a free compiler, here's the performance comparison, here are the unit tests, here are the build instructions", but rather in asking someone else to spend considerable effort on implementing this. [0] https://www.virtualbox.org/ticket/12011 https://www.virtualbox.org/ticket/12011
- yuhong 8y agoYea, this is not about performance. This is about license problems. For code like BIOS, pretty much any good 16-bit C compiler should work.
- Ace17 8y ago> So as an end user of VirtualBox, I would either notice no difference at all (BIOS isn't a performance bottleneck really), or will get a regression due to bugs. Yeah, but we're already getting VirtualBox for free, so we can't only take into account the benefits of the end-users ; if the developers find it more convenient to use this new compiler, so be it.
- zerr 8y ago> using the OpenWatcom compiler [0] for BIOS because it is the only reasonable way to handle x86 segmentation from C. Can you elaborate?
- yuhong 8y ago
- xmodem 8y agoThis is almost as bad as the drive-by "rewrite it in rust" type comments some open source projects get.
- Asiasweatworker 8y agoEven most UEFI/BIOS are compiled by MSVC.and MASM. Why to ignore OVMF?
- yuhong 8y agoThey don't use x86 segmentation and normal gcc should work fine.