Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD
I think the coding standard should enforce a space after // so I'm going to reformat everyone else's code and clutter the diffs

Adbot
ADBOT LOVES YOU

Da Mott Man
Aug 3, 2012


~Coxy posted:

I think the coding standard should enforce a space after // so I'm going to reformat everyone else's code and clutter the diffs

All variables must be in camelCase and prefixed with the type and underscore. All tabs must be exactly three spaces and no line should exceed more than 20 characters, that way I can do code reviews on my phone.

Three-Phase
Aug 5, 2006

by zen death robot

Faith For Two posted:

I'm contributing!

code:
int main(int argc, char** argv, char** envp)
{
    //todo
}

I’d like to propose a modification:

code:
int main(int argc, char** argv, char** envp)
{
   try{
    //todo
    }
    catch (const std::oops& e) {std::cout << "OOPS LOL\n“};
}
This is more robust.

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD

Three-Phase posted:

I’d like to propose a modification:

PLEASE FOLLOW THE PROJECT CODING STANDARD!!!
code:
int main(int argc, char** argv, char** envp)
{
	try
	{
		// todo
	}
	catch (const std::oops& e) 
	{
		std::cout << "OOPS LOL\";
	}
}

MrMoo
Sep 14, 2000

See we're going to have to have return values in now...

C++ code:
int main(int argc, char** argv, char** envp)
{
	try
	{
		// todo
	}
	catch (const std::oops& e) 
	{
		std::cerr << "OOPS LOL" << std::endl;
		exit (EXIT_FAILURE);
	}
	return EXIT_SUCCESS;
}

Three-Phase
Aug 5, 2006

by zen death robot

~Coxy posted:

PLEASE FOLLOW THE PROJECT CODING STANDARD!!!
code:
int main(int argc, char** argv, char** envp)
{
	try
	{
		// todo
	}
	catch (const std::oops& e) 
	{
		std::cout << "OOPS LOL\";
	}
}

YOU’RE AN rear end I AM GOING TO MAKE MY OWN KERNEL AND ITS GOING TO BE BETTER AND ILL SHOW YOU AND EVERYONE ON THIS “TEAM” WHO HAS THE REAL CODING SKILLS AND VISION

Three-Phase
Aug 5, 2006

by zen death robot
PS this is my code now since I added a critical component and if you say or do anything overwise I will DMCA your sorry asses

code:
//THREE-KERNEL 1.00.00.000.00000
//“Always keep it trill.” - Three-Phase
//
//Copyright Three-Phase SA LLC all rights reserved
//By compiling and running this code you agree to
//the licensing agreement set forth in the end-user 
//license agreement and hold Three-Phase SA LLC
//immune to damages that may occur due to use
//blah blah blah blah do not sue

int main(int argc, char** argv, char** envp)
{
	try
	{
		// todo
                // note to self: put important 
                // decompiled stuff here!
	}
	catch (const std::oops& e) 
	{
		std::cout << "OOPS LOL\";
	}
}

Three-Phase fucked around with this message at 03:08 on Nov 22, 2017

Yaoi Gagarin
Feb 20, 2014

MrMoo posted:

See we're going to have to have return values in now...

C++ code:
int main(int argc, char** argv, char** envp)
{
	try
	{
		// todo
	}
	catch (const std::oops& e) 
	{
		std::cerr << "OOPS LOL" << std::endl;
		exit (EXIT_FAILURE);
	}
	return EXIT_SUCCESS;
}

Since we're doing this in C++ I think it only makes sense to make use of C++ features like RAII, like so:

C++ code:
class OperatingSystem {
	OperatingSystem(const OperatingSystem&) = delete;
	OperatingSystem& operator=(const OperatingSystem&) = delete;
public:
	OperatingSystem(int argc, char** argv, char** envp);
	~OperatingSystem();

	void Run();
};

OperatingSystem::OperatingSystem(int argc, char** argv, char** envp)
{
	// todo
}
OperatingSystem::~OperatingSystem()
{
	// todo
}

void OperatingSystem::Run()
{
	// todo
}

int main(int argc, char** argv, char** envp)
{
	try
	{
		OperatingSystem os(argc, argv, envp);
		os.Run();
	}
	catch (const std::oops& e) 
	{
		std::cerr << "OOPS LOL" << std::endl;
		exit (EXIT_FAILURE);
	}
	return EXIT_SUCCESS;
}

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
I don't know much about kernel programming but I know it has to keep going until you power off the machine so ergo it must need an infinite loop.
C++ code:
class OperatingSystem {
	OperatingSystem(const OperatingSystem&) = delete;
	OperatingSystem& operator=(const OperatingSystem&) = delete;
public:
	OperatingSystem(int argc, char** argv, char** envp);
	~OperatingSystem();

	void Run();
};

OperatingSystem::OperatingSystem(int argc, char** argv, char** envp)
{
	// todo
}
OperatingSystem::~OperatingSystem()
{
	// todo
}

void OperatingSystem::Run()
{
	YOLO:
	// todo
	goto YOLO;
}

int main(int argc, char** argv, char** envp)
{
	try
	{
		OperatingSystem os(argc, argv, envp);
		os.Run();
	}
	catch (const std::oops& e) 
	{
		std::cerr << "OOPS LOL" << std::endl;
		exit (EXIT_FAILURE);
	}
	return EXIT_SUCCESS;
}

Bender
May 12, 2001

Fun Shoe
Can I fork your project? I want a version of BSD that runs in Linux.

Da Mott Man
Aug 3, 2012


Bender posted:

Can I fork your project? I want a version of BSD that runs in Linux.

No. The GPL is incompatible with our bespoke licensing.

..btt
Mar 26, 2008

~Coxy posted:

BSD in C++??? It's called Mac/OS/X System 10.0, OP.

I've made a start, sorry about the commit log, I'm lazy

fake edit: lol I was looking through the commits and this is at the top of the latest:

Adbot
ADBOT LOVES YOU

Fredrik1
Jan 22, 2005

Gopherslayer
:rock:
Fallen Rib
C++ code:
class OperatingSystem {
	OperatingSystem(const OperatingSystem&) = delete;
	OperatingSystem& operator=(const OperatingSystem&) = delete;
public:
	OperatingSystem(int argc, char** argv, char** envp);
	~OperatingSystem();

	void Run();
};

OperatingSystem::OperatingSystem(int argc, char** argv, char** envp)
{
	// todo
}
OperatingSystem::~OperatingSystem()
{
	// todo
}

void OperatingSystem::Run()
{
	// todo
}

void main(int argc, char** argv, char** envp)
{
	try
	{
		OperatingSystem os(argc, argv, envp);
		os.Run();
	}
	catch (const std::oops& e) 
	{
		std::cerr << "OOPS LOL" << std::endl;
		exit (EXIT_FAILURE);
	}
	//return EXIT_SUCCESS;
}
I know I'm new at the project but I really think we should use void main, it's what I learned in school.

  • Locked thread