Funny comments in your OS's Source code?

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
User avatar
Coty
Member
Member
Posts: 286
Joined: Thu Feb 12, 2009 5:12 pm

Re: Funny comments in your OS's Source code?

Post by Coty »

One of my projects has a long cat that extends the length of a file... Don't remember what one, I only remember making it...

Code: Select all

;      /\_/\
;     >(^.^)<
;     (")(")
;      |  |
;      |  |
;      |  |
  ...
;      |  |
;     (")(")
;        $
I will also make little things about, sometimes a pun... Sometimes Something from Futurama or family guy will find it's way in their to.
My hero, is Mel.
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: Funny comments in your OS's Source code?

Post by Bender »

From my Operating System Bootloader (POS-64),

Code: Select all

; This is the bootloader for POS-64 for BIOS Systems
; (C) Alldesplay Corporation 2013 under the 2-clause BSD License
; For UEFI see /boot/efi/efiboot.c
; So in this whole big world we only have 2 Firmwares BIOS and EFI
; And both of 'em are just DUMB.
; The first is this stupid,old,useless,garbage BIOS which only knows what's 16-bit and only 
; runs that small 512-byte Code
; and then is this EFI which is so damn worse that you need a HUGE EFI-SDK to write
; a "Hello World" bootloader, I had to cross my internet plans to download the EFI-SDK
Really both of the firmwares have disappointed me a LOT.
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: Funny comments in your OS's Source code?

Post by turdus »

sid123 wrote:EFI which is so damn worse that you need a HUGE EFI-SDK to write a "Hello World" bootloader
[-X Simply ain't true. Rtfm.
http://wiki.osdev.org/UEFI#Example_in_FASM
newanabe
Member
Member
Posts: 46
Joined: Mon Aug 05, 2013 8:15 am

Re: Funny comments in your OS's Source code?

Post by newanabe »

I had to overwrite my mood-dependent label names with another ones. When there are thousands of labels in one source file, that have not to be repeated, names are meaningless often, but at least now they are not in bad language, not the characters names from the series I watch, neither are they in five languages. I just had to remove some thinking comments too. That way haters will criticize less my code if sometime I publish it.
Nable
Member
Member
Posts: 453
Joined: Tue Nov 08, 2011 11:35 am

Re: Funny comments in your OS's Source code?

Post by Nable »

> thousands of labels in one source file, that have not to be repeated
It's definitely time to learn local labels and scopes.
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: Funny comments in your OS's Source code?

Post by Bender »

turdus wrote:
sid123 wrote:EFI which is so damn worse that you need a HUGE EFI-SDK to write a "Hello World" bootloader
[-X Simply ain't true. Rtfm.
http://wiki.osdev.org/UEFI#Example_in_FASM
I program in C, not Assembly, as you can see I tell the programmer to look for boot/efi/efiboot.c
So for that you need a HUGE EFI SDK, I crossed my internet plan for that.
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
b.zaar
Member
Member
Posts: 294
Joined: Wed May 21, 2008 4:33 am
Location: Mars MTC +6:00
Contact:

Re: Funny comments in your OS's Source code?

Post by b.zaar »

I was working on programming some custom hardware with some LED's used for determining position. In the asm code I wrote at the point to disable the LED's

Code: Select all

;Off with their LED's
A lil thing I remember from the Queen of Hearts...
"God! Not Unix" - Richard Stallman

Website: venom Dev
OS project: venom OS
Hexadecimal Editor: hexed
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Funny comments in your OS's Source code?

Post by neon »

sid123 wrote:I program in C, not Assembly, as you can see I tell the programmer to look for boot/efi/efiboot.c
So for that you need a HUGE EFI SDK, I crossed my internet plan for that.
The SDK is provided by the firmware implementation; you do not need to implement it (or download anything for the matter to use it) -- supporting it is far easier then that of the BIOS firmware particularly with that of C boot loaders. By the way, EFI and BIOS firmware are not the only types of firmware; e.g. the Open Firmware standard.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re: Funny comments in your OS's Source code?

Post by bubach »

Most of my comments for non-obvious or hard stuff looks like "//well this wasn't at all fun", "//it's a kludge, i know" or "//wow, move on. never touch this again" and perhaps a brief explanation if i deem it really necessary.

other then that my comments can also sometimes be apologies for the guy that's coming after me, like "// sorry i had no choice" , "// my bad, run out of time" or perhaps blaming the guy before me like "// i was forced doing it this way, becasue of X" :P
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
nerdguy
Member
Member
Posts: 70
Joined: Wed Oct 30, 2013 8:11 am

Re: Funny comments in your OS's Source code?

Post by nerdguy »

This one :

Code: Select all

WARNING : THIS CODE IS VERY WELL UNDOCUMENTED!
READING THROUGH IT MAY CAUSE HEADACHE,BLOOD PRESSURE,ANXIETY,ANGER
READ AT YOUR OWN RISK! 
It isn't funny, but it's cool.
When you say, "I wrote a program that crashed Windows," people just stare at you blankly and say, "Hey, I got those with the system, for free." - Linus Torvalds
64 bit Kernel in early development
http://github.com/nerdguy12/core64
User avatar
hometue
Member
Member
Posts: 100
Joined: Thu Dec 19, 2013 1:40 am
Location: Asia, Singapore

Re: Funny comments in your OS's Source code?

Post by hometue »

Its actually also funny to look at the git commit messages. I know I have tons of weird ones(some showing my lack of programming knowledge). I mean after awhile people get tired and type random stuff like its a blog.
CookieOS. Want a cookie? Its only black and white for now though, probably as bad as my baking skills.
User avatar
Oranos
Member
Member
Posts: 29
Joined: Sat Oct 15, 2011 6:52 pm
Location: Land of Bald Eegels

Re: Funny comments in your OS's Source code?

Post by Oranos »

I've written something like this before:

// This is where the real cake is. It's chocolate ;)
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: Funny comments in your OS's Source code?

Post by qw »

From my parser:

Code: Select all

A definition is a declaration by definition
greyOne
Member
Member
Posts: 58
Joined: Sun Feb 03, 2013 10:38 pm
Location: Canada

Re: Funny comments in your OS's Source code?

Post by greyOne »

Code: Select all

void interrupt(char intr) {
	char code[4];

	/* Black Magic */
	code[0] = 0xCD;	/* interrupt		*/
	code[1] = intr;	/* int number	*/
	code[2] = 0xC2;	/* return		*/
	code[3] = 0x00;

	if(intr == 3) {
		/* Witchcraft */
		code[0] = 0xCC;	/* int 3	*/
		code[1] = 0x90;	/* no op	*/
	}

# if(__GNUC__)
	/* TODO : This works, but is terrible. */
	__asm__ __volatile__(
		"call *%0" ::
		"r"(code)
	);
# elif(_MSC_VER)
	/* TODO : This is probably horribly wrong */
	__asm call code
# else
#	error "Unsupported C Compiler"
# endif /* C Compiler */
}
Black magic and Witchcraft; they are things you encounter in programming.
User avatar
charliegreen
Posts: 3
Joined: Sun Jul 28, 2013 1:43 am
Location: Goleta, CA
Contact:

Re: Funny comments in your OS's Source code?

Post by charliegreen »

My comments (and code) are often somewhat snarky. Here's the code that deals with values from the RTC:

Code: Select all

    if(!(_statB & 0x04)){
        // RTC is using BCD values.... convert them to be sane                                                                                                
        _second  = byteBCDToSanity(_second);
        _minute  = byteBCDToSanity(_minute);
        _hour    = byteBCDToSanity(_hour);
        _day     = byteBCDToSanity(_day);
        _month   = byteBCDToSanity(_month);
        _year    = byteBCDToSanity(_year);
        _century = byteBCDToSanity(_century);
    }
I also have references to things I like all over my code: my warning messages for timer issues usually contain the words "wibbly wobbly timey wimey", and when an interrupt isn't handled, the user is warned that this event damages my calm.
My OS is called Moss. This was originally because I wasn't creative and smashed together "MyOS", but eventually became a commentary on its development speed.
Post Reply