Kernel C++ runtime for x64

Hi all,

I have been using Mark Roddy’s runtime solution for developing C++ kernel code that can be found here:

http://www.hollistech.com/Resources/Cpp/kernel_c_runtime_library.htm

Now I need to do the same but using x64 compiler but I’m seeing the message below:

HtsCpp.lib(cppdata.obj) : warning LNK4254: section ‘.CRT’ (C0000040) merged into ‘.text’ (60000020) with different attributes
LINK : error LNK1218: warning treated as error; no output file generated

I found a thread that discusses this subject but I didn’t find any solution from it:

http://www.techtalkz.com/microsoft-device-drivers/293071-has-anyone-used-m-roddys-c-kernel-runtime-64-bit-driver.html

Does anyone know how to fix that?

Thanks in advance,
Fernando.

Hmmm…

Perhaps I should update those bits. But then again I’m not so valuable
anymore…

I seem to have this resolved in MY versions. I’ll look into it.

Mark Roddy

On Wed, Oct 13, 2010 at 4:08 PM, wrote:
> Hi all,
>
> I have been using Mark Roddy’s runtime solution for developing C++ kernel code that can be found here:
>
> http://www.hollistech.com/Resources/Cpp/kernel_c_runtime_library.htm
>
> Now I need to do the same but using x64 compiler but I’m seeing the message below:
>
> HtsCpp.lib(cppdata.obj) : warning LNK4254: section ‘.CRT’ (C0000040) merged into ‘.text’ (60000020) with different attributes
> LINK : error LNK1218: warning treated as error; no output file generated
>
> I found a thread that discusses this subject but I didn’t find any solution from it:
>
> http://www.techtalkz.com/microsoft-device-drivers/293071-has-anyone-used-m-roddys-c-kernel-runtime-64-bit-driver.html
>
> Does anyone know how to fix that?
>
> Thanks in advance,
> Fernando.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

Just a specific issue: why would anyone want to release nominally usable
code with a GPL license? All this does is guarantee that almost nobody will
want to use it!

I find that most of my clients run as fast as possible in the opposite
direction when they hear “open source”, even under reasonable licenses like
Boost, CodeProject, or OpenBSD. But nobody in their right mind will touch a
piece of code with GPL; this license practically guarantees that nobody will
touch your code with an eleven foot pole (forget ten-foot poles; they’re too
short). Concepts like the “lesser GPL” are lost on them; once “GPL” enters
the conversation, the conversation is over.

I release my own open-source code under a license which does not require
making any end-user source code visible. And I still get questions asking
if I really mean that.

If someone wants to release a useful package in a useful fashion, I think it
is essential to keep as far away from any form of the GPL as possible. This
license has done more harm than good to the open source community. It has
even tainted reasonable open-source projects like Boost.

I realize that open source and GPL are religious issues and this discussion
should probably move elsewhere, but since the posting was here on ntdev, I
thought I should raise the issue.

The GPL and its reputation have certainly done me more harm than good (I
have to tell clients I cannot solve their problem, and I cannot use the GPL
solution because they have ruled out all GPL-based code). I think it is one
of the worst ideas to have hit the software community. This is after many
years of experience with its consequences.
joe

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
Sent: Wednesday, October 13, 2010 4:33 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Kernel C++ runtime for x64

Hmmm…

Perhaps I should update those bits. But then again I’m not so valuable
anymore…

I seem to have this resolved in MY versions. I’ll look into it.

Mark Roddy

On Wed, Oct 13, 2010 at 4:08 PM, wrote:
> Hi all,
>
> I have been using Mark Roddy’s runtime solution for developing C++ kernel
code that can be found here:
>
> http://www.hollistech.com/Resources/Cpp/kernel_c_runtime_library.htm
>
> Now I need to do the same but using x64 compiler but I’m seeing the
message below:
>
> HtsCpp.lib(cppdata.obj) : warning LNK4254: section ‘.CRT’ (C0000040)
merged into ‘.text’ (60000020) with different attributes
> LINK : error LNK1218: warning treated as error; no output file generated
>
> I found a thread that discusses this subject but I didn’t find any
solution from it:
>
>
http://www.techtalkz.com/microsoft-device-drivers/293071-has-anyone-used-m-r
oddys-c-kernel-runtime-64-bit-driver.html
>
> Does anyone know how to fix that?
>
> Thanks in advance,
> Fernando.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
>


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

I agree. What was i thinking?

My team of lawyers is right on top of this.

Mark Roddy

On Wed, Oct 13, 2010 at 5:08 PM, Joseph M. Newcomer
wrote:
> Just a specific issue: why would anyone want to release nominally usable
> code with a GPL license? ?All this does is guarantee that almost nobody will
> want to use it!
>
> I find that most of my clients run as fast as possible in the opposite
> direction when they hear “open source”, even under reasonable licenses like
> Boost, CodeProject, or OpenBSD. ?But nobody in their right mind will touch a
> piece of code with GPL; this license practically guarantees that nobody will
> touch your code with an eleven foot pole (forget ten-foot poles; they’re too
> short). ?Concepts like the “lesser GPL” are lost on them; once “GPL” enters
> the conversation, the conversation is over.
>
> I release my own open-source code under a license which does not require
> making any end-user source code visible. ?And I still get questions asking
> if I really mean that.
>
> If someone wants to release a useful package in a useful fashion, I think it
> is essential to keep as far away from any form of the GPL as possible. ?This
> license has done more harm than good to the open source community. ?It has
> even tainted reasonable open-source projects like Boost.
>
> I realize that open source and GPL are religious issues and this discussion
> should probably move elsewhere, but since the posting was here on ntdev, I
> thought I should raise the issue.
>
> The GPL and its reputation have certainly done me more harm than good (I
> have to tell clients I cannot solve their problem, and I cannot use the GPL
> solution because they have ruled out all GPL-based code). ?I think it is one
> of the worst ideas to have hit the software community. ?This is after many
> years of experience with its consequences.
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?joe
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Mark Roddy
> Sent: Wednesday, October 13, 2010 4:33 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] Kernel C++ runtime for x64
>
> Hmmm…
>
> Perhaps I should update those bits. But then again I’m not so valuable
> anymore…
>
> I seem to have this resolved in MY versions. I’ll look into it.
>
> Mark Roddy
>
>
>
> On Wed, Oct 13, 2010 at 4:08 PM, ? wrote:
>> Hi all,
>>
>> I have been using Mark Roddy’s runtime solution for developing C++ kernel
> code that can be found here:
>>
>> http://www.hollistech.com/Resources/Cpp/kernel_c_runtime_library.htm
>>
>> Now I need to do the same but using x64 compiler but I’m seeing the
> message below:
>>
>> HtsCpp.lib(cppdata.obj) : warning LNK4254: section ‘.CRT’ (C0000040)
> merged into ‘.text’ (60000020) with different attributes
>> LINK : error LNK1218: warning treated as error; no output file generated
>>
>> I found a thread that discusses this subject but I didn’t find any
> solution from it:
>>
>>
> http://www.techtalkz.com/microsoft-device-drivers/293071-has-anyone-used-m-r
> oddys-c-kernel-runtime-64-bit-driver.html
>>
>> Does anyone know how to fix that?
>>
>> Thanks in advance,
>> Fernando.
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> –
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

I use c++ in the kernel, but all I ever needed was to write my own global new and delete functions.
Granted I don’t use c++ exceptions, or global objects, so perhaps my situation is different.
I’ll have to look at Mark’s code … Do I need to write to your lawyer team Mark ?

Joe,

Has it ever occurred to you that there are people who don’t live by the almighty dollar? Has it ever occurred to you that people actually want to help other people out there and teach them something? You should try looking at the GPL as a way that people can help other people out rather than a profit margin enhancer. Are there people that… stretch the point of the GPL out? Of course there are. ITS FREE! But I think (and please Mark just write me an e-mail if I am wrong. I hate my Lawyer with an undying passion right now) Mark’s point was to throw an idea out there so that someone could learn something. If I understand the GPL correctly its to make sure that everyone who wants to use the code base makes sure that it gets passed on to others so that they too can learn. Do I think this is a smart idea for someone like HP? No of course not. The point here is: I’m pretty sure Mark was trying to teach us something with this code; rather than increase someone’s profit margin. And if the OP wants to learn from it and use it’s ideas and is okay with the fact that if he copies and pastes he had better make his source available to whoever wants it. Who cares? If the OP isn’t… then this thread should get real interesting.

But before this thread becomes completely hijacked. Wouldn’t the entire solution have to be reworked because it’s a 64 bit OS??? (From the ground up)

I don;t know specifically how Mark has implemented his CRT. However, the
.CRT section is readonly and you are trying to merge it int .text which is
read-write-execute. This article doesn’t specifically address the WDK x64
compiler, however, I believed that the comments may be applicable here. Why
are you merging .CRT into .text? Wouldn’t merging it into .rdata be a
better choice?

Regards,

George.

> Just a specific issue: why would anyone want to release nominally usable code with a GPL license?

All this does is guarantee that almost nobody will want to use it!

Well, you seem to be asking a question and giving an answer to it at the same time…

The point of the whole exercise is to ensure that no one uses the code _ in_ unmodified_ form_ in a project licensed in a way that is not compatible with GPL. You are still free to use it as a reference in your proprietary product regardless of your license as long as you don’t directly reuse its code, but if you want to directly reuse it your license has to be compatible with GPL. If these terms are not acceptable to you…well, then just don’t use it.

If someone wants to release a useful package in a useful fashion, I think it is essential to keep as far
away from any form of the GPL as possible.

Before making statements like that one should, first of all, give his/her/its definition of “useful”…

This license has done more harm than good to the open source community.

The GPL and its reputation have certainly done me more harm than good

So is it you or is it open source community who gets “harmed” by GPL???

I have to tell clients I cannot solve their problem, and I cannot use the GPL solution because they have
ruled out all GPL-based code

So how does it “harm” the open-source community??? Instead, things seem to be working exactly how they are supposed to - those who don’t want to release their code under GPL cannot directly reuse GPLed code in their project. Probably, it somehow harms the above mentioned clients, but this is their own choice, right…

To summarize, you have NO IDEA of what you are talking about and attacking something for the sole purpose of attacking it - some kind of " a rebel without a clue"…

…I realize that open source and GPL are religious issues

WEll, this thread is titled “Kernel C++ …”, after all…

It is too-well-known to all NTDEV regulars that any thread titled this way has all chances in the world to become “exciting”. Therefore, you decided to prove it yet another time (please note that GPL issues originally
were nowhere in sight - you are 100% responsible for hijacking this thread)

Anton Bassov

George M. Garner Jr. wrote:

I don;t know specifically how Mark has implemented his CRT. However, the
.CRT section is readonly and you are trying to merge it int .text which is
read-write-execute. This article doesn’t specifically address the WDK x64
compiler, however, I believed that the comments may be applicable here. Why
are you merging .CRT into .text? Wouldn’t merging it into .rdata be a
better choice?

The user mode Microsoft C run-time library in VS2008 and VS2005 merges
CRT into .rdata, so that makes two votes for your solution.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

xxxxx@gmail.com wrote:

I use c++ in the kernel, but all I ever needed was to write my own global new and delete functions.
Granted I don’t use c++ exceptions, or global objects, so perhaps my situation is different.
I’ll have to look at Mark’s code …

Exceptions are hopeless. I have seen it done, but the magic required to
make that work in the kernel frightened me. I backed slowly away.

The global thing is the item Mark’s code addresses. Your global object
constructors won’t get run without a little assistance. It’s not very
much code.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

>

Just a specific issue: why would anyone want to release nominally
usable
code with a GPL license? All this does is guarantee that almost
nobody will
want to use it!

I find that most of my clients run as fast as possible in the opposite
direction when they hear “open source”, even under reasonable licenses
like
Boost, CodeProject, or OpenBSD. But nobody in their right mind will
touch a
piece of code with GPL; this license practically guarantees that
nobody will
touch your code with an eleven foot pole (forget ten-foot poles;
they’re too
short). Concepts like the “lesser GPL” are lost on them; once “GPL”
enters
the conversation, the conversation is over.

I release my own open-source code under a license which does not
require
making any end-user source code visible. And I still get questions
asking
if I really mean that.

If someone wants to release a useful package in a useful fashion, I
think it
is essential to keep as far away from any form of the GPL as possible.
This
license has done more harm than good to the open source community. It
has
even tainted reasonable open-source projects like Boost.

I realize that open source and GPL are religious issues and this
discussion
should probably move elsewhere, but since the posting was here on
ntdev, I
thought I should raise the issue.

GPL isn’t that hard to understand. The fact that you are expressing a
bunch of opinions as fact and using a lot of weasel word language makes
me think that you’re a little religious about the subject.

The GPL and its reputation have certainly done me more harm than good
(I
have to tell clients I cannot solve their problem, and I cannot use
the GPL
solution because they have ruled out all GPL-based code). I think it
is one
of the worst ideas to have hit the software community. This is after
many
years of experience with its consequences.

The GPL works very well for many many people and organisations, as
evidenced by the number of people and organisations using it. The fact
that your client doesn’t want to use it says more about your client than
it does about the GPL.

James

C++ exceptions consume too much stack space for kernel mode. Maybe someone
will disagree with me; but that is my opinion. In user mode I rarely find
the need to throw anything more than an integer value anyway.

Regards,

George.

“Tim Roberts” wrote in message news:xxxxx@ntdev…
> xxxxx@gmail.com wrote:

> Exceptions are hopeless.

Sorry. Forgot to post the link to the article to I referred in the previous
post:
http://msdn.microsoft.com/en-us/library/ms235500(VS.80).aspx.

Isn’t this your problem?

Regards,

George.

How much stack do they use?

Here - cppdata.cpp known to work with Win7 WDK compiler for all things not IA64:

#define _CRTALLOC(x) __declspec(allocate(x))

#pragma section(“.CRT$XCA”,long,read)
#pragma section(“.CRT$XCZ”,long,read)

_CRTALLOC(“.CRT$XCA”) PVFV __crtXca = { NULL };
_CRTALLOC(“.CRT$XCZ”) PVFV __crtXcz = { NULL };

//
// this may or may not be required
//
#pragma comment(linker, “/merge:.CRT=.rdata”)

And I don’t think there is any sort of license on that at all.

Mark Roddy

On Wed, Oct 13, 2010 at 4:08 PM, wrote:
> Hi all,
>
> I have been using Mark Roddy’s runtime solution for developing C++ kernel code that can be found here:
>
> http://www.hollistech.com/Resources/Cpp/kernel_c_runtime_library.htm
>
> Now I need to do the same but using x64 compiler but I’m seeing the message below:
>
> HtsCpp.lib(cppdata.obj) : warning LNK4254: section ‘.CRT’ (C0000040) merged into ‘.text’ (60000020) with different attributes
> LINK : error LNK1218: warning treated as error; no output file generated
>
> I found a thread that discusses this subject but I didn’t find any solution from it:
>
> http://www.techtalkz.com/microsoft-device-drivers/293071-has-anyone-used-m-roddys-c-kernel-runtime-64-bit-driver.html
>
> Does anyone know how to fix that?
>
> Thanks in advance,
> Fernando.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>

On Wed, 13 Oct 2010 17:08:16 -0400
“Joseph M. Newcomer” wrote:

> Just a specific issue: why would anyone want to release nominally
> usable code with a GPL license? All this does is guarantee that
> almost nobody will want to use it!

Because they don’t want that software ending up in a commercial, closed
source piece of software.

> I find that most of my clients run as fast as possible in the opposite
> direction when they hear “open source”, even under reasonable
> licenses like Boost, CodeProject, or OpenBSD. But nobody in their
> right mind will touch a piece of code with GPL; this license
> practically guarantees that nobody will touch your code with an
> eleven foot pole (forget ten-foot poles; they’re too short).
> Concepts like the “lesser GPL” are lost on them; once “GPL” enters
> the conversation, the conversation is over.

I’ve heard that some companies even ban their employees from looking
at GPL code for fear of contamination.

People clearly need to be better educated because there’s lots of
software out there that is BSD/MIT/Apache/etc. licensed and can be used
just by adding some text to the documentation.

> The GPL and its reputation have certainly done me more harm than good
> (I have to tell clients I cannot solve their problem, and I cannot
> use the GPL solution because they have ruled out all GPL-based
> code). I think it is one of the worst ideas to have hit the software
> community. This is after many years of experience with its
> consequences. joe

It’s a great idea for those who don’t like closed source, commercial
applications; it’s frustrating for those of us who are trying to make a
living making such applications!


Bruce Cran

> It’s a great idea for those who don’t like closed source, commercial applications; it’s frustrating for those

of us who are trying to make a living making such applications!

The only thing I can say to that is “try to find some other way of making a living then - in the long run, you are on the way to the middle of nowhere”…

The problem is that the concept of desktop PC that stores all its apps and data on its hard disk seems to be living its last days, and, hence, the business model that relies upon selling apps is threatened by the concept of delivering subscription-based services across the net much more than it is threatened by GPL.

If you take into account rapidly-growing computing power of various smartphones, PDAs and other handheld devices and combine it with with advances in wireless technology, the future we are heading to becomes pretty obvious - all your actual stuff is on the server and is accessible to you via a thin client. As a result, you can access your “virtual computer” from any geographical location and without having to worry about data loss in case your thin client gets broken/lost/stolen/etc.

The whole model does not seem to leave much room for proprietary commercial apps that get purchased and installed by the end user, don’t you think…

Anton Bassov

On Thu, 14 Oct 2010 12:25:17 +0300, Bruce Cran wrote:
> It’s a great idea for those who don’t like closed source, commercial
> applications; it’s frustrating for those of us who are trying to make a
> living making such applications!

Authors can distribute their works under more than one license. One could
use the (L)GPL for the masses (as free advertisement) and some
closed-source license for paying customers.
Of course, it may be hard to retroactively establish multi-licensing
options for a project with many contributors, but the GPL doesn’t enforce
collaboration in the first place.
Those who object to the GPL solely or primarily on the ground that they
cannot use GPLed works in any way they please are essentially asking for a
free ride.

Do you trust the cloud? :slight_smile:
–pa

wrote in message news:xxxxx@ntdev…
>
>
>> It’s a great idea for those who don’t like closed source, commercial
>> applications; it’s frustrating for those
>> of us who are trying to make a living making such applications!
>
>
> The only thing I can say to that is “try to find some other way of making
> a living then - in the long run, you are on the way to the middle of
> nowhere”…
>
> The problem is that the concept of desktop PC that stores all its apps and
> data on its hard disk seems to be living its last days, and, hence, the
> business model that relies upon selling apps is threatened by the concept
> of delivering subscription-based services across the net much more than it
> is threatened by GPL.
>
>
> If you take into account rapidly-growing computing power of various
> smartphones, PDAs and other handheld devices and combine it with with
> advances in wireless technology, the future we are heading to becomes
> pretty obvious - all your actual stuff is on the server and is accessible
> to you via a thin client. As a result, you can access your “virtual
> computer” from any geographical location and without having to worry about
> data loss in case your thin client gets broken/lost/stolen/etc.
>
>
> The whole model does not seem to leave much room for proprietary
> commercial apps that get purchased and installed by the end user, don’t
> you think…
>
>
> Anton Bassov
>
>

Thanks Mark,

Are you intending update this on your web page?
I’d be glad on talk about that updating my blog post about your tool.

http://driverentry.com.br/en/blog/?p=81

Regards,
Fernando.