Devon and Cornwall GNU/Linux Users Group

  • About DCGLUG
    • FAQ
    • Join
    • Meetings
    • Mailing List Archive
  • About : GNU / Linux
    • Federated social media
    • Video on Free software
    • Video on DRM
    • Video on Creative Commons
    • Hacker / Hacking definition
  • Tutorials
    • BASH Tutorials
    • e-learning
    • My Sql
    • LaTeX and Overleaf
    • Send Plain text e-mail
    • Tutorial : GnuPG – Encryption & Signing
  • CHAT (IRC) / Matrix
    • IRC – Client Setup
      • Weechat Setup guide
      • Hexchat Setup
      • IRSSI Configuration
      • xchat – setup
      • ERC Setup
      • Chat – Matrix
    • DCGLUG on Mastodon

Basic OS development with Visual Studio

Posted on 2021-01-11 by Matthew Lugg

Recently I came across an add-on for Visual Studio 2013 named Cosmos, which lets you use C# or Visual Basic to develop a fully independent OS. I have been working on one now for a couple of weeks. Sadly, Cosmos is still in early development stages, but it is still possible to make basic graphical OS’s. This post uses C#, but it is just as easy to use Visual Basic. My current code is:

Source code   
using System;
using System.Collections.Generic;
using System.Text;
using Sys = Cosmos.System;
using Cosmos.Hardware;
using Cosmos.Hardware.BlockDevice;
 
namespace CosmosOS
{
    public class Kernel : Sys.Kernel
    {
        protected override void BeforeRun()
        {
            while (true)
            {
                Run();
            }
        }
 
        protected override void Run()
        {
            string input = Console.ReadLine();
            string input1 = input.ToLower();
            if (input1 == "shutdown" || input1 == "quit" || input1 == "exit") Shutdown();
            else if (input1 == "reboot" || input1 == "restart" || input1 == "reload") Reboot();
 
            else Console.WriteLine("Command \"" + input1 + "\" not recognized!");
        public void Shutdown()
        {
            this.Stop();
            Cosmos.Core.Bootstrap.CPU.Halt();
        }
        public void Reboot()
        {
 
        }
        public static void WriteData(byte[] aData, ulong block)
        {
            if (BlockDevice.Devices.Count > 0)
            {
                for (int i = 0; i < BlockDevice.Devices.Count; i++)
                {
                    var xDevice = BlockDevice.Devices[i];
                    if (xDevice is Partition)
                    {
                        xDevice.WriteBlock(block, 1, aData);
                    }
                }
 
            }
 
        }
        public static byte[] ReadData(ulong block)
        {
            byte[] aData = new byte[] { 1 };
            if (BlockDevice.Devices.Count > 0)
            {
                for (int i = 0; i < BlockDevice.Devices.Count; i++)
                {
                    var xDevice = BlockDevice.Devices[i];
                    if (xDevice is Partition)
                    {
                        aData = xDevice.NewBlockArray(1);
                        xDevice.ReadBlock(block, 1, aData);
                    }
                }
 
            }
            return aData;
        }
    }
}

Lets go over some of this code.

Source code   
protected override void BeforeRun()
        {
            while (true)
            {
                Run();
            }
        }

This Run function is looped by default anyway, but it loops slightly faster when this code is put in BeforeRun.

 

Source code   
protected override void Run()
        {
            string input = Console.ReadLine();
            string input1 = input.ToLower();
            if (input1 == "shutdown" || input1 == "quit" || input1 == "exit") Shutdown();
            else if (input1 == "reboot" || input1 == "restart" || input1 == "reload") Reboot();
 
            else Console.WriteLine("Command \"" + input1 + "\" not recognized!");

This is fairly trivial code for a command-line OS, simple input.

 

Source code   
public void Shutdown()
        {
            this.Stop();
            Cosmos.Core.Bootstrap.CPU.Halt();
        }
        public void Reboot()
        {
 
        }

This is my own shutdown code. I have yet to figure out reboot, though.

 

Source code   
public static void WriteData(byte[] aData, ulong block)
        {
            if (BlockDevice.Devices.Count > 0)
            {
                for (int i = 0; i < BlockDevice.Devices.Count; i++)
                {
                    var xDevice = BlockDevice.Devices[i];
                    if (xDevice is Partition)
                    {
                        xDevice.WriteBlock(block, 1, aData);
                    }
                }
 
            }
 
        }
        public static byte[] ReadData(ulong block)
        {
            byte[] aData = new byte[] { 1 };
            if (BlockDevice.Devices.Count > 0)
            {
                for (int i = 0; i < BlockDevice.Devices.Count; i++)
                {
                    var xDevice = BlockDevice.Devices[i];
                    if (xDevice is Partition)
                    {
                        aData = xDevice.NewBlockArray(1);
                        xDevice.ReadBlock(block, 1, aData);
                    }
                }
 
            }
            return aData;
        }

I got this code from a forum and modified it a little to make it work – it writes arrays of bytes to the hard disk. Sadly the built-in FAT fileystem can currently only read files, so you will have to make your own.

 

This is a fun tool to just play around with, although it is extremely limited at the moment.
http://www.nikeairmaxfreerun.com nike air max thea

Posted in Uncategorized | 2 Comments |

Open Street Map

Posted on 2021-01-09 by Paul Sutton

Open Street Map

OpenStreetMap is a map of the world, created by people like you and free to use under an open license.

Open Street Map is a great project that anyone can get involved with, using open data so mapping data can be used freely in accordance with the terms on the website.

Embedded maps are also interactive


View Larger Map

Links

* Open Street Map

#openstreetmap,#data,#mapping,#open,#project

Creative Commons Licence
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License

Posted in 2021, advocacy, OpenStreetMap | Leave a comment |

Peertube

Posted on 2021-01-05 by Paul Sutton

What is Peertube

So following my post on the [3rd January](https://personaljournal.ca/paulsutton/cuttlefish-peertube-client) on Cuttlefish. The video below provides a good explanation of what Peertube is.

* Joinpeertube
* Sepia Search  Search Peertube for content.

 

Creative Commons Licence
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License

Posted in 2021, Activty Pub, advocacy | Leave a comment |

South Devon Tech Jam Meeting

Posted on 2021-01-01 by Paul Sutton
South Devon Tech Jam – Virtual Meeting
We are back,  Just virtually using Big Blue Button – video conferencing
Saturday, January 9, 2021
11:00 AM
to 2:00 PM GMT
Details from our Meetup page.
contact e-mail for more details  : info AT sdtj DOT org DOT uk
Posted in 2021, advocacy, Arduino, ARM Development, coding, development, documentation, education, hacking, Hardware, HTML5, Internet Safety, Learning, programming, Raspberry pi, Scratch 3, South Devon Tech Jam | 2 Comments |

January Meeting

Posted on 2021-01-01 by Paul Sutton

DCGLUG virtual meeting (jitsi) Day / Date: Saturday 16/1/2021 Time: From 12:00 Location: Online – Meeting jit.si link

Meeting going ahead,  while it is Boxing day some members have confirmed they would like the meeting to go ahead.

Posted in Uncategorized | Leave a comment |

About the DCGLUG

Posted on 2020-12-31 by Paul Sutton

GNU logo Tux

DEVON, CORNWALL & SOUTH WEST LINUX USER GROUP


 

A group of GNU/Linux and Free software enthusiasts based in Devon and Cornwall. We hold some monthly meetings and have an e-mail discussion list, Matrix & IRC Channels. Feel free to post questions and connect with others interested in Free software.

Posted in 2021, 4 freedoms, advocacy | 3 Comments |

Mastodon and the Fediverse

Posted on 2020-12-29 by Paul Sutton

If you are not sure what Mastodon and the Fediverse are there is a really good explanation on this here.

 

Creative Commons Licence
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License

Posted in 2020, Activty Pub, Explanation, Mastodon | Leave a comment |

December Meeting

Posted on 2020-12-01 by Paul Sutton

DCGLUG virtual meeting (jitsi) Day / Date: Saturday 26/12/2020 Time: From 12:00 Location: Online – Meeting jit.si link

Meeting going ahead,  while it is Boxing day some members have confirmed they would like the meeting to go ahead.

Posted in Uncategorized | Leave a comment |

Free Code Camp

Posted on 2020-02-20 by Paul Sutton

Free Code Camp

If you are looking to learn about creating websites then Free Code Camp offer a free Responsive Web Design Course.  You can sign up and work through all the activities at your own pace.  Thee is an online forum to get help, help others.

http://www.freecodecamp.org

We are working through this at the Paignton Code Club and at the South Devon Tech Jam

Posted in 2020, Activty Pub, Code Club, coding, CSS3, D3.ja, Databases, Git, GitHub, HTML5, JavaScript, Learning, Node.js, React.js, Responsive, South Devon Tech Jam, Web Design | Leave a comment |

Repl.it Languages

Posted on 2019-10-18 by Paul Sutton

Repl.it

Languages

Repl.it supports a wide range of development languages, which makes it a good option to learn and develop solutions.   Now supports multi user collaboration by default. This means that you can work with other developers on solutions and get help in real time.

repl.it languages

You can discuss more on Twitter @dcglug and Friendica 

Above list created with LaTeX – Source code project can be viewed here.

 

Posted in Uncategorized | Leave a comment |
« Previous Page
Next Page »

Recent Posts

  • Game development in Rust with Macroquad
  • European search index
  • LF – Build Linux Device Drivers
  • OpenFest
  • Lug Meets – May 2025

RSS Debian Security

  • DSA-5917-1 libapache2-mod-auth-openidc - security update
  • DSA-5916-1 chromium - security update
  • DSA-5915-1 vips - security update

RSS Debian News

  • Updated Debian 12: 12.10 released
  • The Debian Project mourns the loss of Steve Langasek (vorlon)
  • Updated Debian 12: 12.9 released

CyberChimps WordPress Themes

© 2021 Devon and Cornwall GNU/Linux Users Group