Displaying amount of RAM and Time & Date

Feb 22, 2012 at 8:23 PM
Edited Feb 22, 2012 at 8:32 PM

I've been away from cosmos for for about a year and right now I am working on a new text based operating system but I have a few problems I need help with.I need to make a command were the user will be able to see the amount of RAM their computer has and a command were the user will be able to see the date and the time.I don't have any code yet for both of these but if anyone would be able to give me code for them that would be great. :D

BTW I'm using MS4

Feb 22, 2012 at 8:53 PM
stevenator wrote:

I've been away from cosmos for for about a year and right now I am working on a new text based operating system but I have a few problems I need help with.I need to make a command were the user will be able to see the amount of RAM their computer has and a command were the user will be able to see the date and the time.I don't have any code yet for both of these but if anyone would be able to give me code for them that would be great. :D

BTW I'm using MS4

To get the time and date you would use Cosmos.Hardware.RTC and Ram is Cosmos.Core.CPU.GetAmountOfRAM(); I know the RTC works in MS4, and I believe the GetAmountOfRAM does as well. Hope this helps - Matt

Feb 22, 2012 at 8:55 PM

for the amount of ram i can you help you out !

just use this :

var input = console.Readline();
if (input =="getamountofram")
{
   var ram = Cosmos.Core.CPU.GetAmountOfRAM();
               Console.WriteLine("Your system has:");
               Console.WriteLine(ram + " "+"MegaBytes");
               Console.WriteLine("of ram memory");
}
hope this already helps !

Developer
Feb 22, 2012 at 8:56 PM

RTC works in the dev-kit as well.

Feb 22, 2012 at 8:56 PM

matt 

i saw you were able to answer when i was 

oh nevermind

Feb 22, 2012 at 9:25 PM
HD2HD wrote:

matt 

i saw you were able to answer when i was 

oh nevermind

Sorry I am just always skimming when I have time trying to help others =). Thanks - Matt

Feb 22, 2012 at 9:27 PM
HD2HD wrote:

matt 

i saw you were able to answer when i was 

oh nevermind

Sorry I am just always skimming when I have time trying to help others =). Thanks - Matt

Feb 22, 2012 at 9:59 PM
Edited Feb 22, 2012 at 10:09 PM

The Line " var ram = Cosmos.Core.CPU.GetAmountOfRAM(); " needs the Cosmos.Core reference requires Net. 4.0 Framework and Visual C# only go's up to 3.5 .

I've tried updating but for some reason whenever I compile in Visual Studio 2010 it gives me an error and when I go to open up a new Cosmos Project it is empty.So I have to use Visual C# Express Edition until I can resolve this.

 

I've done the RTC but for some reason it shows me just the number of the hour in 24-hour format and a male smiley symbol next to it.

Developer
Feb 22, 2012 at 11:19 PM

Update your .net Framework.

Feb 22, 2012 at 11:28 PM

I did but for some reason .net Framework is not compatible with Visual Studio C# 2008 Express.I'll just try to update my 2008 version to 2010 C#.

Feb 23, 2012 at 12:00 AM
Edited Feb 23, 2012 at 12:01 AM

BTW thanks HD2HD :D

Feb 23, 2012 at 12:00 AM
Edited Feb 23, 2012 at 12:01 AM
.
Feb 23, 2012 at 7:40 AM
stevenator wrote:

I've been away from cosmos for for about a year and right now I am working on a new text based operating system but I have a few problems I need help with.I need to make a command were the user will be able to see the amount of RAM their computer has and a command were the user will be able to see the date and the time.I don't have any code yet for both of these but if anyone would be able to give me code for them that would be great. :D

BTW I'm using MS4

Why use MS4? You should update to 87612 or DevKit!

Feb 23, 2012 at 12:55 PM
stevenator wrote:

BTW thanks HD2HD :D

No problem !

Feb 23, 2012 at 10:47 PM
Edited Feb 23, 2012 at 10:49 PM
Aurora01 wrote:
stevenator wrote:

I've been away from cosmos for for about a year and right now I am working on a new text based operating system but I have a few problems I need help with.I need to make a command were the user will be able to see the amount of RAM their computer has and a command were the user will be able to see the date and the time.I don't have any code yet for both of these but if anyone would be able to give me code for them that would be great. :D

BTW I'm using MS4

Why use MS4? You should update to 87612 or DevKit!

I did update but I'm getting some errors and now I'm getting an error as ms4 compiles my project that says "/Cosmos User Kit/Tools/asm/main.asm:70313:error symbol '_CODE_REQUESTED_BREAK' undefined" it was working perfectly but now its not but still I did update to Visual Studio 2010 C# and when I press the debug button it says "Project with an Output Type Of Class Library could not be started directly".Most of it confuses me because its not explaining to me the error.I don't want to worry much of MS4 because its a little outdated,I want to worry about getting my Visual Studio 2010 C# to compile my project into the iso.And I need Step by Step to fix this error in Visual Studio 2010 C#.

Feb 24, 2012 at 7:42 AM

Firstly, MS4 only works with VS2008 and secondly, do you mean you installed MS4, then 87612, without uninstalling MS4?

Coordinator
Feb 24, 2012 at 7:51 AM
you can use latest releases with VS2010 (including express editions). You just have to create a new cosmos project (and class libary in express) and port your code over..


On Fri, Feb 24, 2012 at 8:42 AM, Aurora01 <notifications@codeplex.com> wrote:

From: Aurora01

Firstly, MS4 only works with VS2008 and secondly, do you mean you installed MS4, then 87612, without uninstalling MS4?

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

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


Feb 25, 2012 at 7:16 AM
Aurora01 wrote:

Firstly, MS4 only works with VS2008 and secondly, do you mean you installed MS4, then 87612, without uninstalling MS4?

Yhea I did install 87612 without uninstalling MS4 but I fixed that thanks for reminding me :D

Feb 25, 2012 at 8:11 AM

Yeah, that would have made it do unusual things :)

-Aurora

Jan 12, 2014 at 2:06 AM
HD2HD wrote:
for the amount of ram i can you help you out ! just use this : var input = console.Readline(); if (input =="getamountofram") { var ram = Cosmos.Core.CPU.GetAmountOfRAM(); Console.WriteLine("Your system has:"); Console.WriteLine(ram + " "+"MegaBytes"); Console.WriteLine("of ram memory"); } hope this already helps !
Can't you just use :
var ram = Cosmos.Kernel.CPU.AmountOfMemory;
instead of :
var ram = Cosmos.Core.CPU.GetAmountOfRAM();