Page 2 of 4
Re: Funny comments in your OS's Source code?
Posted: Wed Aug 14, 2013 10:01 pm
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.
Re: Funny comments in your OS's Source code?
Posted: Fri Oct 18, 2013 10:58 pm
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.
Re: Funny comments in your OS's Source code?
Posted: Sat Oct 19, 2013 2:53 pm
by turdus
sid123 wrote:EFI which is so damn worse that you need a HUGE EFI-SDK to write a "Hello World" bootloader
Simply ain't true. Rtfm.
http://wiki.osdev.org/UEFI#Example_in_FASM
Re: Funny comments in your OS's Source code?
Posted: Sat Oct 19, 2013 3:25 pm
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.
Re: Funny comments in your OS's Source code?
Posted: Sat Oct 19, 2013 4:48 pm
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.
Re: Funny comments in your OS's Source code?
Posted: Sat Oct 19, 2013 8:56 pm
by Bender
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.
Re: Funny comments in your OS's Source code?
Posted: Sat Oct 19, 2013 10:48 pm
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
A lil thing I remember from the Queen of Hearts...
Re: Funny comments in your OS's Source code?
Posted: Sun Oct 20, 2013 12:30 am
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.
Re: Funny comments in your OS's Source code?
Posted: Tue Oct 22, 2013 1:45 pm
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"
Re: Funny comments in your OS's Source code?
Posted: Tue Nov 05, 2013 6:13 am
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.
Re: Funny comments in your OS's Source code?
Posted: Thu Dec 19, 2013 4:31 am
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.
Re: Funny comments in your OS's Source code?
Posted: Sat Dec 28, 2013 9:09 pm
by Oranos
I've written something like this before:
// This is where the real cake is. It's chocolate
Re: Funny comments in your OS's Source code?
Posted: Sun Dec 29, 2013 5:14 am
by qw
From my parser:
Code: Select all
A definition is a declaration by definition
Re: Funny comments in your OS's Source code?
Posted: Sun Dec 29, 2013 12:10 pm
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.
Re: Funny comments in your OS's Source code?
Posted: Fri Jan 10, 2014 11:33 am
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.