MinGW: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
No edit summary
No edit summary
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Stub}}
'''MinGW''' (Minimalist GNU for Windows) is a port of several GNU utilities to the Windows console environment, including the GCC / binutils toolchain. It is less sophisticated than Cygwin, but more compact with a lower overhead. It is most widely used in conjunction with the [[Dev-C++]] and CodeBlocks [[:Category:IDEs|IDE]].
'''MinGW''' (Minimalist GNU for Windows) is a port of several GNU utilities to the Windows console environment, including the GCC / binutils toolchain. It is less sophisticated than Cygwin, but more compact with a lower overhead. It is most widely used in conjunction with the [[Dev-C++]] and CodeBlocks [[:Category:IDEs|IDE]].

==OSDev==
{{Disputed|Talk:MinGW}}

You are encouraged to use [[Cygwin]] instead of MinGW for OSDeving. MinGW has a collection of issues that make it poorly suited for our needs:

# (GCC 2.95) <tt>ld -r -d ...</tt> 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.
# <tt>ld -Ttext=NNN ...</tt> 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.
# MinGW '<tt>make</tt>' uses '<tt>sh</tt>' as the shell if it finds '<tt>sh</tt>' on the path. This is the Wrong Thing, as the <tt>SHELL</tt> and <tt>COMSPEC</tt> environment variables should be evaluated (like e.g. DJGPP '<tt>make</tt>' does).

It ''is'' possible to create a Multiboot-kludge compatible kernel, though. If you are interested you can visit FreeDOS-32; its kernel can be compiled by MinGW.

<pre>
/* 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__ = . ;
}
}
</pre>


==See Also==
==See Also==
Line 50: Line 10:
===External Links===
===External Links===
*http://www.mingw.org/
*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


[[Category:Compilers]]
[[Category:Compilers]]
[[Category:Windows]]

Latest revision as of 18:57, 9 July 2023

This page is a stub.
You can help the wiki by accurately adding more contents to it.

MinGW (Minimalist GNU for Windows) is a port of several GNU utilities to the Windows console environment, including the GCC / binutils toolchain. It is less sophisticated than Cygwin, but more compact with a lower overhead. It is most widely used in conjunction with the Dev-C++ and CodeBlocks IDE.

See Also

Articles

Forum

External Links