mnemonic pointers

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.
Post Reply
User avatar
yemista
Member
Member
Posts: 299
Joined: Fri Dec 26, 2008 12:31 pm
Location: Boston
Contact:

mnemonic pointers

Post by yemista »

In the higher half kernel wiki page, they show some mnemonic pointers, such as 0xcafebabe, 0xdeadbeef, and 0xdeadc0de. I was just wondering if anyone knew of any other ones?
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Re: mnemonic pointers

Post by JohnnyTheDon »

0xC0FFEE
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: mnemonic pointers

Post by AJ »

Hi,

One I use in my project (Caracal) quite a bit: 0xCA8ACA1 - I understand this may be of limited use to anyone else :) Don't forget the multibot ones, based around 0x..BADB00.. . I'm sure there must be loads of others about.

Cheers,
Adam
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: mnemonic pointers

Post by Troy Martin »

Last edited by Troy Martin on Fri Feb 20, 2009 10:28 pm, edited 1 time in total.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: mnemonic pointers

Post by AndrewAPrice »

0xBAB1ED00
(Baby doo)

Google returns nothing - I invented this magic number!
My OS is Perception.
User avatar
steveklabnik
Member
Member
Posts: 72
Joined: Wed Jan 28, 2009 4:30 pm

Re: mnemonic pointers

Post by steveklabnik »

I was poking around Wikipedia the other day, and found out that Java uses 0xCAFEBABE for .class files...
User avatar
Firestryke31
Member
Member
Posts: 550
Joined: Sat Nov 29, 2008 1:07 pm
Location: Throw a dart at central Texas
Contact:

Re: mnemonic pointers

Post by Firestryke31 »

Socks uses 0x464F5800 (on disk) as it's executable signature. I wanted something better for validation than just a plain binary but still simple to handle, so a simple 'cmp dword [bx], 0x00584F46 / jne .cleanup' fit the bill perfectly.

That's the null-terminated ASCII string "FOX" for those who are too lazy to convert it.
Owner of Fawkes Software.
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: mnemonic pointers

Post by Troy Martin »

A Dr. Seuss fan, are we, Firestryke? :)

I use 0xBADC0FFEE0DDF00D to fill up AX:BX:CX:DX after a register dump is made and the system is halted when TBOS crashes.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Firestryke31
Member
Member
Posts: 550
Joined: Sat Nov 29, 2008 1:07 pm
Location: Throw a dart at central Texas
Contact:

Re: mnemonic pointers

Post by Firestryke31 »

Another magic number that I have yet to use is 0x467572727946756E because I haven't yet needed a 64-bit magic number, though I did split it and use it as the sentinel values for my memory allocation structure before I stopped working on that project in favor of Socks. I like it, but when it comes to technical definitions it isn't a very good one due to being an even non-negative number without a recognizable bit pattern (unless you view the ASCII translation).

I've also come up with 0xB007 (BOOT) and 0xFB05 (FBOS, for Firebird OS) which are better magic numbers, but 16-bit because Firebird was originally meant to be for the TI-83+.
Owner of Fawkes Software.
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: mnemonic pointers

Post by Troy Martin »

Firestryke31 wrote:0x467572727946756E
That's just a little disturbing.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Firestryke31
Member
Member
Posts: 550
Joined: Sat Nov 29, 2008 1:07 pm
Location: Throw a dart at central Texas
Contact:

Re: mnemonic pointers

Post by Firestryke31 »

Image And why is that?
Owner of Fawkes Software.
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
xyzzy
Member
Member
Posts: 391
Joined: Wed Jul 25, 2007 8:45 am
Libera.chat IRC: aejsmith
Location: London, UK
Contact:

Re: mnemonic pointers

Post by xyzzy »

Although its a short one, an older version of my kernel used 0xEF as its system call interrupt number - stands for "Exclaim FTW!" :). I also use this for other magic numbers - for example, I use a special ELF auxilary vector type, 0xEFEF0001, to pass the address of the kernel-provided system call library to userspace apps.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: mnemonic pointers

Post by Troy Martin »

I used to use 0x534F4254 (little endian, so stored in a NASM dd) to signify TBOS programs in the pre-release of 0.5.0 before I decided to stick with a flat binary. I plan to crash TBOS32 with something funny in a 128-bit way :)
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
Firestryke31
Member
Member
Posts: 550
Joined: Sat Nov 29, 2008 1:07 pm
Location: Throw a dart at central Texas
Contact:

Re: mnemonic pointers

Post by Firestryke31 »

Another signature I used once or twice was 0x31415926 because while it isn't supposed to be ASCII it can still be typed using the keyboard ("1AY&").
Owner of Fawkes Software.
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: mnemonic pointers

Post by JamesM »

0xDEADBABA is my favourite. From an ex maths teacher who liked dead baby jokes, and who would answer multiple-choice question papers with that order of answers (from A - D) to see how he scored.
Post Reply