Complete Windows 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.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Complete Windows Source Code

Post by pcmattman »

I thought this was funny:

Code: Select all

 /* Source Code to Windows 2000 */
 /* Compiled by Rajiv */
 
 #include "win31.h"
 #include "win95.h"
 #include "win98.h"
 #include "workst~1.h"
 #include "evenmore.h"
 #include "oldstuff.h"
 #include "billrulz.h"
 #include "monopoly.h"
 #define INSTALL = HARD
 
 char make_prog_look_big[1600000];
 
 void main()
 {
 while(!CRASHED)
 {
 display_copyright_message();
 display_bill_rules_message();
 do_nothing_loop();
 if (first_time_installation)
 {
 make_50_megabyte_swapfile();
 do_nothing_loop();
 totally_screw_up_HPFS_file_system();
 search_and_destroy_the_rest_of_OS/2();
 make_futile_attempt_to_damage_Linux();
 disable_Netscape();
 disable_RealPlayer();
 disable_Lotus_Products();
 hang_system();
 }
 
 write_something(anything);
 display_copyright_message();
 do_nothing_loop();
 do_some_stuff();
 
 if (still_not_crashed)
 {
 display_copyright_message();
 do_nothing_loop();
 basically_run_windows_3.1();
 do_nothing_loop();
 do_nothing_loop();
 }
 }
 
 if (detect_cache())
 disable_cache();
 
 if (fast_cpu())
 {
 set_wait_states(lots);
 set_mouse(speed, very_slow);
 set_mouse(action, jumpy);
 set_mouse(reaction, sometimes);
 }
 /* printf("Welcome to Windows 3.1"); */
 /* printf("Welcome to Windows 3.11"); */
 /* printf("Welcome to Windows 95"); */
 /* printf("Welcome to Windows NT 3.0"); */
 /* printf("Welcome toW indows 98"); */
 /* printf("Welcome to Windows NT 4.0"); */
 printf("Welcome to Windows 2000");
 
 if (system_ok())
 crash(to_dos_prompt)
 else
 system_memory = open("a:\swp0001.swp",O_CREATE);
 while(something)
 {
 sleep(5);
 get_user_input();
 sleep(5);
 act_on_user_input();
 sleep(5);
 }
 create_general_protection_fault();
 }
 }
User avatar
Bughunter
Member
Member
Posts: 94
Joined: Mon Dec 18, 2006 5:49 am
Location: Netherlands
Contact:

Post by Bughunter »

What's so funny about this? This is real-life! :lol:
GLneo
Member
Member
Posts: 237
Joined: Wed Dec 20, 2006 7:56 pm

Post by GLneo »

Code: Select all

/*
	TOP SECRET Microsoft(c) Code
	Project: Chicago(tm)
	Projected release-date: Summer 1998

	Fixed a few bugs, and renamed it to Windows 98
	- Jimmy
*/

#include "win31.h"
#include "win95.h"
#include "appleOS7.h"
#include "dos6.h"
#include "evenmore.h"
#include "oldstuff.h"
/* #include "unistd.h"  -- needed if you compile on Unix, much faster this way */

/* Make users think they're getting "value for money" */
#ifdef _WINDOWS_98_
	#include "dvd.h"
#endif
 
char make_prog_look_big[4194304];
#ifdef _WINDOWS_98_
	char make_prog_look_bigger[8388608];
#endif
 
void main(void) {
	short sleep_time;
 
	while(!CRASHED) {
 
		display_copyright_message();
		sleep(60);
 
		if (first_time_installation()) {
			make_swapfile(rand()%85);    /* random-sized swap file 'cos what the hell  ??  */
			sleep(60);

/* IMPORTANT!  Remove the following five lines if Department Of Justice
   require this portion of code */
			totally_screw_up_HPFS_file_system();
			search_and_destroy_the_rest_of_OS/2();
			search_and_destroy_Netscape();
			tamper_with_realnetworks_code();
			search_and_destroy_not-microsoft();

			if ((rand()%2)==0) flag_installation_successful();
			hang_system();
		}
		sleep(60);
		do_some_fancy_graphics();
		sleep(60);
	}
 
	if (still_not_crashed) {
		display_copyright_message();
		sleep(60);
		run_windows_3.1();
		sleep(120);
	}
 
	if (detect_cache()) disable_cache();
	if (fast_cpu() && !COMPAQ) {     /* We did a deal with Compaq */
		set_wait_states(lots);
		set_mouse(speed, very_slow);
		set_mouse(action, jumpy);
		set_mouse(reaction, sometimes);
	}

	/* printf("Welcome to MacOS"); */
	/* printf("Welcome to Windows 3.11"); */
	/* printf("Welcome to Windows 95"); */
 
	printf("Welcome to Windows 98");
 
	if (system_ok()) crash(to_dos_prompt);
	else system_memory = open("a:\swp0001.swp", O_CREATE);
 
/* Windows 98 should be "faster" than Windows 95 */
	#ifdef ( _WINDOWS_98_ || _WINDOWS_NT_ )
		sleep_time=2;
	#else
		#ifdef _WINDOWS_95_
			sleep_time=5;
		#else
			sleep_time=8;
		#endif
	#endif

main_loop:
	while(user_not_busy()) {
		if (!COMPAQ) sleep(sleep_time);     /* Part of our deal with Compaq */
		get_user_input();
		if (!DELL) sleep(sleep_time);      /* But we also did a deal with Dell */
		act_on_user_input();
		sleep(sleep_time);
	}

 
/* Some random events to keep the user on their toes */
	switch((rand()%10)+1) {
		case 1: sleep(sleep_time); break;
		case 2: sleep(sleep_time); break;
		case 3: beep();
			hang_system();
			break;
		case 4: sleep(sleep_time*2); break;
		case 5: create_invalid_page_fault();
			#ifdef _WINDOWS_NT_
				blue_screen_of_death();
			#endif
			break;
		case 6: sleep(sleep_time*rand()); break;
		case 7: /* Don't GPF in Win98, this is a "bug fix" */
			#ifndef _WINDOWS_98_
				create_general_protection_fault();
			#endif
			break;
		case 8: sleep(sleep_time); break;
		case 9: sleep(sleep_time); break;
		case 10: shutdown(); break;   /* for good measure */
	}

	goto main_loop;  /* best coding practices and all that */
}
GLneo
Member
Member
Posts: 237
Joined: Wed Dec 20, 2006 7:56 pm

Post by GLneo »

Code: Select all

#include 
#include 
#include  /* Microsoft Network Connectivity
                           library */
#include  /* For the court of law */

#define say(x) lie(x)
#define computeruser ALL_WANT_TO_BUY_OUR_BUGWARE 
#define next_year soon
#define the_product_is_ready_to_ship_another_beta_version

void main()
{
  if (latest_window_version>one_month_old)
  {
    if (there_are_still_bugs)
      market(bugfix);
    if (sales_drop_below_certain_point)
      raise(RUMOURS_ABOUT_A_NEW_BUGLESS_VERSION);
  }
  while(everyone_chats_about_new_version)
  {

make_false_promise(it_will_be_multitasking); 
                        /* Standard Call, in lie.h */
     if (rumours_grow_wilder)
       make_false_promise(it_will_be_plug_n_play);
     if (rumours_grow_even_wilder)
     {
       market_time=ripe;
       say("It will be ready in one month);
       order(programmers, stop_fixing_bugs_in_old_version);
       order(programmers, start_brainstorm_about_new_version);
       order(marketingstaff, permission_to_spread_nonsense);
       vapourware=TRUE;
       break;
      }
   }
   switch (nasty_questions_of_the_worldpress)
   {
    case WHEN_WILL_IT_BE_READY:
      say("It will be ready in", today+30_days," 
           we're just testing"); break;
    case WILL_THIS_PLUG_AND_PLAY_THING_WORK:
        say("Yes it will work");
        ask(programmers, why_does_it_not_work);
        pretend(there_is_no_problem);
        break;
     case WHAT_ARE_MINIMAL_HARDWARE_REQUIREMENTS:
        say("It will run on a 8086 with lightning speed due to"
            " the 32 bits architecture");
        inform(INTEL, "Pentium sales will rise skyhigh");
        inform(SAMSUNG, "Start a new memorychip plant"
            "'cos all those customers will need at least 32 megs");
        inform(QUANTUM, "Thanks to our fatware your
             sales will triple");        
        get_big_bonus(INTEL, SAMSUNG, QUANTUM); 
     break;
      case DOES_MICROSOFT_GET_TOO_MUCH_INFLUENCE:
        say("Oh no, we are just here to make a better world for
             everyone");
        register(journalist, Big_Bill_Book);
        when(time_is_ripe)
        {
          arrest(journalist);
          brainwash(journalist);
          when(journalist_says_windows95_is_bugfree)
          {
            order(journalist, "write a nice objective article");
            release (journalist);
          }
        }
        break;
    }
    while (vapourware)
    {
      introduction_date++; /* Delay */
      if (no_one_believes_anymore_there_will_be_a_release)
        break;
      say("It will be ready in",today+ONE_MONTH);
   }
   release(beta_version)
   while (everyone_is_dumb_enough_to_buy_our_bugware)
   {
     bills_bank_account += 150*megabucks;
     release(new_and_even_better_beta_version);
     introduce(more_memory_requirements);
     if (customers_report_installation_problems)
     {
       say("that is a hardware problem, not a software problem");
       if (smart_customer_says_but_you_promised_plug_and_play)
       {
         ignore(customer);
         order(microsoft_intelligence_agency, "Keep an eye on this
                                               bastard");
       }
     }
     if ( bills_bank_account>skyhigh && marriage>two_years )
     {
       divorce(woman_that_was_beatiful_when_I_married_her);
       wave(dollars, at_lusty_chicks);
       marry(young_blond_virgin_with_big_boobies);
       devirginize(young_blond_virgin_with_big_boobies);
       if (boobies_start_to_hang)

         dump(young_blond_virgin_with_big_boobies);
     }
     if (there_is_another_company)
     {
       steal(their_ideas);
       accuse(compagny, stealing_our_ideas);
       hire(a_lot_of_lawyers); /* in process.h */
       wait(until_other_company_cannot_afford_another_lawsuit);
       buy_out(other_company);
     }
   }
   /* Now everyone realizes that we sell bugware and
         they are all angry at us */
          order(plastic_surgeon, 
              make_bill_look_like_poor_bastard);
          buy(nice_little_island); hire(harem);
          laugh_at(everyone,
for_having_the_patience_year_after_year_for_another_unfinished_version);
 }

void bugfix(void)
{
   charge (a_lot_of_money)
   if (customer_says_he_does_not_want_to_pay_for_bugfix)
     say("It is not a bugfix but a new version");
   if (still_complaints)
   {
     ignore(customer);
     register(customer, big_Bill_book);
     /* We'll get him when everyone uses Billware!!*/
   }
}
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Post by earlz »

you guys are idiots!
microsoft wouldn't use C, they use qbasic!!

lol..I don't even remember basic syntax stuff, so I can't make fun in my joke :( oh well..
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

Pretty old, but still somewhat funny:
http://www.albinoblacksheep.com/flash/winrg.php
User avatar
XCHG
Member
Member
Posts: 416
Joined: Sat Nov 25, 2006 3:55 am
Location: Wisconsin
Contact:

Post by XCHG »

Actually I have nothing against Windows. I don't know why but I really believe Windows is one of THE best Operating Systems. It has support for, uh, support for um it supports a lot of things and basically Windows comes with a lot of bonus stuff. I got a pack of macaroni and cheese in Windows XP package and I'm pretty happy about my purchase.

About the source code, I think we have to give Microsoft programmers a break. There are plenty of very good programmers working for MS. One of them happens to be my friend; his name is Kermit and he has written all the functions exported in Kernel32.dll as attached to this post.
Attachments
Windows 2003 running smoothly on Commodore 64.
Windows 2003 running smoothly on Commodore 64.
Windows running on Commodore.PNG (68.37 KiB) Viewed 1695 times
On the field with sword and shield amidst the din of dying of men's wails. War is waged and the battle will rage until only the righteous prevails.
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Post by piranha »

I think I can remember some basic..... lets see.....

Something like:

PRINT $Copyright
Call ScrewUpComputer
Call Crash
PRINT "You, user are an incompetent fool."
PRINT "Repairing Harddrive with scandisk..."
Call SearchAndDestroyNOTMICROSFT
Call Implant_Embedded_Virus 'This comes with Windows!
IF COMPUTER = OK THEN
Call Annoy_the_user_relentlessly
ELSE
DO
PRINT "A:"
Call GetInput
sleep 5 '5 sec to make it look like DOS is doing something
PRINT "CANNOT FIND PROGRAM, FILE OR BATCH FILE"
IF Get_Random_Number_From_One_To_Three = 2 THEN
Call Crash
End If
LOOP
END IF
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

I had a feeling everyone would have opinions about my post...

I like the contributions :D
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Post by AndrewAPrice »

If you can prove you're part of IT faculty at a college, Microsoft will give you access to the Windows Research Kernel (a fancy branding for the latest Windows kernel along with full source code).
My OS is Perception.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

MessiahAndrw wrote:If you can prove you're part of IT faculty at a college, Microsoft will give you access to the Windows Research Kernel (a fancy branding for the latest Windows kernel along with full source code).
Woah.

* Signs up for IT college faculty and crosses fingers *
* Once in, zips up code and posts it online *
* Hides away while the lawsuits run their course *
* Becomes an Open-Source hero! *
User avatar
dc0d32
Member
Member
Posts: 69
Joined: Thu Jun 09, 2005 11:00 pm
Location: Right here

Post by dc0d32 »

well, this has happened :!:

dont tell anyone :P I've seen [you probably know what "seeing" means when an osdev says it] the windows 2000 source code [well not all, much of it, including kernel, IE, Windows media player and what not] :shock:
It was wandering over the e2dk p2p network, which a friend of mine downloaded.

I dint copy it to my HDD, because i feared M$ guys would track me down somehow :lol:
Last edited by dc0d32 on Sat Jul 07, 2007 10:52 pm, edited 1 time in total.
User avatar
Alboin
Member
Member
Posts: 1466
Joined: Thu Jan 04, 2007 3:29 pm
Location: Noricum and Pannonia

Post by Alboin »

Why would you want it to begin with? :wink:

If you want to learn from an OS I would sway more towards Tanenbaum.
C8H10N4O2 | #446691 | Trust the nodes.
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Post by earlz »

I'd be curious as to some of the comments of it...

Code: Select all

...
/*MemoryCheck(); We gain 80ns per CD read without this, so disabled it*/
...
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post by Colonel Kernel »

Alboin wrote:Why would you want it to begin with? :wink:

If you want to learn from an OS I would sway more towards Tanenbaum.
No. Tanenbaum has a lot of great things to say about the theory of OS architecture, but the Minix code is total crap (at least 2.0 was -- I haven't looked at 3.0 yet). Search for some of the other threads where I've ranted about Tanenbaum... I don't feel like repeating myself too much right now. ;)

As for studying Windows, legal issues aside, I don't see anything wrong from learning about it on a technical level. Its VMS heritage is very interesting. For a non-microkernel (difficult to call it "monolithic" really) it's not bad. Or, if you think it's bad, study it and learn what not to do. ;)

Don't assume that you'll earn brownie points just by bashing Windows. As much as I hate to use it, it still has educational value for OS dev.
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
Post Reply