MinGW: Difference between revisions
Jump to navigation
Jump to search
[unchecked revision] | [unchecked revision] |
Content added Content deleted
No edit summary |
No edit summary |
||
Line 46: | Line 46: | ||
==See Also== |
==See Also== |
||
===Articles=== |
===Articles=== |
||
[[GCC]] |
*[[GCC]] |
||
[[Cygwin]] |
*[[Cygwin]] |
||
===Forum=== |
===Forum=== |
||
*[[Topic:10089|Osdeving with MinGW]] |
*[[Topic:10089|Osdeving with MinGW]] |
Revision as of 06:40, 6 January 2007
MinGW (Minimalist GNU for Windows) is a port of several GNU utilities to the Windows console environment, including GCC. It is less sophisticated than Cygwin, but more compact and has a lower overhead. It is most widely used in conjunction with the Dev-C++ and CodeBlocks IDE.
Note that
- MinGW is a 10+ megabyte download and, like Cygwin, now requires a helper DLL (MSYS-1.0.DLL). So it's no longer "minimal".
- MinGW 'make' uses 'sh' as the shell if it finds 'sh' on the path. This is the Wrong Thing. DJGPP 'make' works better: it looks at the SHELL and COMSPEC environment variables.
OSDev
Really, you're advised not to use MinGW for OSDeving, but instead to use Cygwin. MinGW has a collection of issues that make it poorly suited for our needs:
- (GCC 2.95) ld -r -d ... doesn't get rid of all the common variables.
- (GCC 2.95) BSS size is stored in the wrong location of the section header, so MinGW does not correctly interoperate with NASM.
- ld -Ttext=NNN ... doesn't put the .text section at the correct address unless you also use the --image-base=0 option.
- Linker claims to support ELF, but says "PE operations on non PE file" if you try to use ELF.
But if you write a link script, you'll still be able to make it able to be a Multiboot-kludge compatible kernel. If you are interested you can visit FreeDOS-32 and its kernel can be compiled by MinGW.
/* The link script ( Note: the format should be "pe-i386" instead of "pei-i386" to ged rid of the "MZ" header. text and data sections should be close to each other. ) */ OUTPUT_FORMAT("pe-i386") ENTRY(start) SECTIONS { .text :{ *(.text) } .data ADDR(.text) + SIZEOF(.text) :{ *(.data) *(.data2) *(.rdata) __data_end__ = . ; } .bss ADDR(.data) + SIZEOF(.data) : { *(.bss) *(COMMON) __bss_end__ = . ; } }
See Also
Articles
Forum
External Links
- http://www.mingw.org/
- http://my.execpc.com/~geezer/os/index.htm#borealis - Chris Giese tip-toed around the bugs and got his kernel to build with MinGW