strings and "Yes, somehow this method is getting called."

Topics: Compiler, Developing Cosmos (Working on Cosmos source code directly), Using Cosmos (Developing your own OS, projects, etc)
Jun 1, 2013 at 2:11 AM
I am trying to do an if statement with strings (to translate keyboard input to a number) but got an error :
Error   1   Native code encountered, plug required. Please see http://cosmos.codeplex.com/wikipage?title=Plugs). System.Int32  System.Globalization.CompareInfo.InternalCompareString(System.IntPtr, System.String, System.String, System.Int32, System.Int32, System.String, System.Int32, System.Int32, System.Int32).
 Called from :
System.Int32  System.Globalization.CompareInfo.Compare(System.String, System.String, System.Globalization.CompareOptions)
System.Int32  Microsoft.VisualBasic.CompilerServices.Operators.CompareString(System.String, System.String, System.Boolean)
System.Void  VBKernel1.VBKernel1.Kernel.getakey()
System.Void  VBKernel1.VBKernel1.Kernel.Run()
System.Void  Cosmos.System.Kernel.Run()

   at Cosmos.IL2CPU.ILScanner.ScanMethod(MethodBase aMethod, Boolean aIsPlug, Object sourceItem) in D:\source\Cosmos\source2\IL2CPU\Cosmos.IL2CPU\ILScanner.cs:line 821
   at Cosmos.IL2CPU.ILScanner.ScanQueue() in D:\source\Cosmos\source2\IL2CPU\Cosmos.IL2CPU\ILScanner.cs:line 970
   at Cosmos.IL2CPU.ILScanner.Execute(MethodBase aStartMethod) in D:\source\Cosmos\source2\IL2CPU\Cosmos.IL2CPU\ILScanner.cs:line 322
   at Cosmos.Build.MSBuild.IL2CPUTask.Execute() in d:\source\Cosmos\source2\Build\Cosmos.Build.MSBuild\IL2CPUTask.cs:line 231   C:\Program Files (x86)\MSBuild\Cosmos\Cosmos.targets    32  10  Cosmos3
(it always says line 32 column 10 even when there is no line 32 column 10)
I looked it up and found this workaround
which works, other than the fact that the console always displays "Yes, somehow this method is getting called.". how can I prevent this? Is there any way other than clearing the display?
thanks
~Patrick
Jun 1, 2013 at 2:31 AM
I expanded my code, then realised that I actually does not work, any single digit input triggers the first check, whether the correct character ("0") or not.
Developer
Jun 1, 2013 at 2:46 AM

I would suggest Int32.Parse();

Jun 1, 2013 at 2:50 AM
I would suggest write your own implemenation
Coordinator
Jun 1, 2013 at 8:26 AM
Seriously grunt: why are you always advertising people not using any cosmos implemented stuff?

Many things do work...
Other things which might currently not work are easy to fix and contribute...



Developer
Jun 1, 2013 at 9:44 AM
+1 mterwoord ...
Jun 1, 2013 at 5:56 PM
Because it gives you guys a really bad reputation on other forums. As MacHeads101 puts it
Speaking of trolls.  You are not writing a REAL OS if you don't write it YOUR FUCKING SELF. You can't use some bullshit that essentially makes coding an OS like coding a desktop application.
Coordinator
Jun 1, 2013 at 6:24 PM

Then you should know our main objective: making it easy to make embedded, let me repeat embedded operating systems, focussing on a relatively small set of tasks.

Anyway, if cosmos is not what you yourself are looking for, I fully respect that. It's the whole "it sucks, you can do it better yourself" message that is just plain rude and insulting.

Op 1 jun. 2013 19:56 schreef "GruntXProductions" <[email removed]> het volgende:

From: GruntXProductions

Because it gives you guys a really bad reputation on other forums. As MacHeads101 puts it
Speaking of trolls. You are not writing a REAL OS if you don't write it YOUR FUCKING SELF. You can't use some bullshit that essentially makes coding an OS like coding a desktop application.

Read the full discussion online.

To add a post to this discussion, reply to this email ([email removed])

To start a new discussion for this project, email [email removed]

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Jun 1, 2013 at 7:27 PM
mterwoord wrote:
Then you should know our main objective: making it easy to make embedded, let me repeat embedded operating systems, focussing on a relatively small set of tasks. Anyway, if cosmos is not what you yourself are looking for, I fully respect that. It's the whole "it sucks, you can do it better yourself" message that is just plain rude and insulting. Op 1 jun. 2013 19:56 schreef "GruntXProductions" <[email removed]> het volgende: From: GruntXProductions Because it gives you guys a really bad reputation on other forums. As MacHeads101 puts it Speaking of trolls. You are not writing a REAL OS if you don't write it YOUR FUCKING SELF. You can't use some bullshit that essentially makes coding an OS like coding a desktop application. Read the full discussion online. To add a post to this discussion, reply to this email ([email removed]) To start a new discussion for this project, email [email removed] You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com. Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com
+2 Mterwoord
Jun 1, 2013 at 8:15 PM
. It's the whole "it sucks, you can do it better yourself" message that is just plain rude and insulting.
I never said that? Were are you getting that from? That quote was just from a somewhat famous Youtuber. But anyways I understand the goals of Cosmos, but I just think that IL2CPU should be a different project. The thing I like about Cosmos is the fact that you can develop an OS in C# and some people just want to be able to do that alone. However when people see an OS with the word Cosmos in it they automatically think that it was just something that was generated in 5 minutes by someone who has no clue what they are doing, which is not always the case and was what I was trying to show by quoting that comment from MacHeads101 .
Jun 1, 2013 at 9:52 PM
Grunt what are you talking about? Boxxy is the only "famous youtuber", and like your quote author, has nothing to do with cosmos. You seem so bothered about what random other people on random other forums think or say. None of that matters in the least, no-one cares. It's not a competition. If it makes you unhappy, stop going to one or the other of the places.

IMO what you are actually seeing is that cosmos, because it's quick and relatively easy to get going, is usable by a wide range of people.

No-one sits down and re-writes functionality when they don't need to. Look at Linux and GNU. You use c#? You don't start by sitting down and writing a BCL for it. What a silly notion.

Stop coming to this project's place and suggesting or advising against the project's goals and direction. Stop suggesting that it's broken. The place for those things is elsewhere, where people that support this project, or work hard on it, don't have to read it.
Jun 1, 2013 at 10:39 PM
I was not advising against anyone's goals. I simply suggested that patrickl27 writes his own implementation of what ever he was trying to do, as from is post it looks like it is clearly not working. Yes my 'quote' does have something to do with Cosmos, as it relates to the bad reputation Cosmos has gained on other forums such as OS Dev Forum. This bad rep is the result of people using Cosmos to put together some little DOS clone without any research into what they are doing and practicing bad coding habbits. Also how is encouraging users to write their own implementations a bad thing? That is actually more beneficial towards the programmer and Cosmos as the user will actually learn something and then an unimplemented thing in Cosmos will now be implemented and the user can contribute. Also I never suggested that anything was broken, all I suggested was that IL2CPU be separate, because that in its self can be adapted to compile native win32 applications written in .net languages and several other things. Also Cosmo's VSIP libraries make proper kernel developement a very hard task. There are several things that should be left up to the user, that Cosmos has already implemented and restricts the users choice in kernel design and other various things such as hardware abstraction. For example, lets look at Cosmos's implemenation of Console. There are no standard streams at all which is something that is key for any operating system. Because of this though most users who have done about no research into OS development or kernel design will just continue to use this and completely neglect to implement standard streams. Kernels can be designed in several ways, so it is key to let the user have the choice to choose how his/her kernel will function. You can't use the Linux kernel to make a NT like kernel and vice versa.
Jun 2, 2013 at 5:18 AM
Maybe your posts in this thread are being misread or misunderstood.

The original post was (probably) a new user getting an error saying "plug missing". The general response to this in the past has been - "implement the plug or use other, already implemented 'primitive' functions to work around the lack of implementation". It's annoying folks keep posting plug missing errors, without reading the actual error and even more the link it goes to, but the response doesn't really change.

Maybe your reply was suggesting the user implement the plug, not implement a workaround / alternative?

But your next reply and quote is just silly... No-one works from a place of "what will other forums think/feel if I do X? I better not do THAT then!". Why do you keep suggesting it does matter? Not only does it have NO bearing on this project, but the reasons people are suggesting this are very suspect. I suspect that it's a combination of annoyance with young inexperienced users (and their questions), and fear of feeling their own progress or achievements are reduced because someone can quickly and with little experience can produce somewhat similar results to whatever they had to work at to get to.

IMO atm if someone is going to use cosmos seriously they will need to be working on the full version, full source. The other version is an on-ramp at this point, I would say. It's kind of a problem because the project has certain things still not implemented, but it is SO approachable that people can quickly get going without having to understand the current progress or status.
But, if the core is worked on, and people actually submit missing plugs and Interfaces, the project will be at a point where the userkit version would be more than an on-ramp. People will be able to create a dos clone without having to care about hardware abstractions, interrupts, assembler and so on. If they want to do that, it does not hurt anyone. Everyone starts somewhere, and if it interests them what does it matter? I don't have to hear about it. They can start learning, playing, having a hobby, taking an interest ... all without having to go learn about a whole load of stuff us poor folks who actually lived through the 80s had to deal with, and mostly were happy to see the back of.

You mention streams, in relation to console implementations. I think you would be talking standard input/output/error streams. I have a recollection that cosmos had no interface support, which I think blocked using most BCL streams as they all use interfaces to provide actual functionality, and that this was all tied to needing certain bugs fixed ... the last step in that chain being getting debugging working and whatnot, so the bugs could be fixed, so someone might actually get to interfaces.

But in order to read keyboard input, allowing you to type in simple commands, and in order to output text, so the system can give you feedback ... you don't need POSIX or DOS Streams. And in order to serve web pages, you don't need posix or dos streams. In fact you don't need any dos or posix compatibility at all. The OS would boot, the (limited) console could get input if needed, but mostly be a debug output log, and once working could just not exist at all, and the whole system could straight away get on with having just a web (HTTP) in/out system as the only methods of interaction with it. Yes, it would really want to be done using BCL streams, but it would not care in the least about any kind of console compatibility or posix/dos streams.

The reality is that most people don't implement a kernel anyhow. Most people use a kernel someone else wrote. COSMOS lets you quickly get on with using their kernel, but more importantly, do that using the very fast on-ramp of dot net code. They can actually skip all that technical kernel stuff and move right on to providing value in some way - actual functionality a user consumes... just like what c#/vb provide to the developer at the "userland" level. Maybe that's a console app that lets you guess numbers, to demo core function. Maybe it's my headless web server running my latest MVC app with nothing between it and "the metal".

Lots of folks will come to cosmos with no interest in developing a kernel, and no interest in working on a kernel at all. If the project moves ahead, that will actually be fine. It should be thought of as providing a pre-built kernel that basically provides a "dot net runtime compatible virtual machine". Imagine whatever mono on Linux or dot net on Windows provides as a baseline. From the start you can write in any dot net language, and all the built in BCL functions are just there, working. You can take your dot net code and just have it run.

Then if you care you can start tinkering with the kernel implementation, and look at doing your own stuff, like alternate garbage collectors, or AppDomain security models, or HALs, or whatever. But most people won't do that ... they will write some c# that will function on MS dot net VM, and then plonk that into a cosmos project and have it boot directly on a VM, and not have anything wasting CPU cycles or memory, beyond literally running only the code they want to.

They won't care what some guy they never met or even heard of, on some forum they never heard of, thought about this project. And they won't care that HE spent hours coding posix compatible streams from scratch in his "MYOS Kernel". They won't care, cos they will have their OS up and running without having to worry about all that stuff.

I can understand if he derives his self worth from having coded posix-compatible streams into his kernel, he might be threatened by that ... but the problem there is with how he values himself, not this project.


Re: IL2CPU, you mean .. like NGen?
Jun 2, 2013 at 6:06 AM
I'll have to admit you make a good point, and that quote was not needed. However if the users are not willing to implement stuff on their own, then no one else besides the two developers will be willing to implement anything and the majority of posts on here are users asking about stuff that is not implemented (Like this thread). Although with a finished Cosmos users will not need to worry about that stuff, at its current stage if anyone wants Cosmos to advance to something that can be used for easily creating embeded systems, or server software like you mentioned, then they need to be capable of implementing unimplemented stuff.
Jun 3, 2013 at 5:44 PM
+1 Grunt
Jun 3, 2013 at 9:03 PM
There are 2 or even 3 projects wrapped in one here. IL to native compilation, VS integration and tooling, and cosmos runtime implementation (which you can think of as drivers, OS dev, plugs, so on). That 3rd might even be split into multiple projects, depending on how you view it.

The overwhelming majority of people posting about plug questions are not posting because what they really want to do is learn how to implement the plugs, or missing lower level elements like interfaces into the compiler. They are asking "what does this error (that looks like gibberish to me) mean I have to do to make my dos clone console app that happens to be boot-able work".

Even less likely that someone who came here due to OS development of even a basic level, wants to go spiraling off into VS tooling, SQL DLL stuff, installer debugging, and so on. It's the wrong rabbit hole, unfortunately. A tedious one with no direct link to operating systems.

The person starting this thread went a step or 2 beyond most people that post this same kind of query, actually searching and so on. All props to him for that.

Most likely tho, he wanted to get what could just as well be a straight console application, working, and able to boot to it.

So imo -1 .. they don't need to be capable of implementing those things - interfaces, plugs, and so on. They often WON'T be capable of doing that. They'll wait, and hopefully the devs find the time and move the project forward. And that's okay, because the end point VS integrated click to build, no questions asked, no understanding necessary (when it does get there), was always their on-ramp.

sadly also, -1 for the tasks they can get involved in. :-( Each time I look at this project, I am hoping MTerwood and Kudzu have managed to find the time to finish the blocking tasks they stick on, because I know they already see so much more than is implemented, have had it planned out, even roughed out, mocked up, etc, for years now. Well. Fingers crossed, as ever.
Coordinator
Jun 4, 2013 at 6:14 AM
Kudzu and me fully agree the project as it is now should be split, but that takes even more time, as the 3 parts Flatlined785 described are all inter-related, and we would have to manage the dependencies (and first spend time untying them in some way). We have (very) limited resources, and we'd rather focus those resources on moving forward.


Developer
Jun 7, 2013 at 6:24 AM
It'd be nice to keep these discussions to relevant, constructive topics instead of bitching at each other.


Developer
Jun 7, 2013 at 6:57 AM
The most correct post by someone is by Cman332
"It'd be nice to keep these discussions to relevant, constructive topics instead of bitching at each other."

+1 to this thought


Regards
Aman Priyadarshi