Is the second law of thermodynamics a fundamental law, or does it emerge from other laws? My question is basically this. Is the second law of thermodynamics a fundamental, basic law of physics, or does it emerge from more fundamental laws?
Let's say I was to write a massive computer simulation of our universe. I model every single sub-atomic particle with all their known behaviours, the fundamental forces of nature as well as (for the sake of this argument) Newtonian mechanics. Now I press the "run" button on my program - will the second law of thermodynamics become "apparent" in this simulation, or would I need to code in special rules for it to work? If I replace Newton's laws with quantum physics, does the answer change in any way?
FWIW, I'm basically a physics pleb. I've never done a course on thermodynamics, and reading about it on the internet confuses me somewhat. So please be gentle and don't assume too much knowledge from my side. :)
 A: It has not be proven that The Second Law of Thermodynamics is physically derived from other basic physical principles. The H-Theorem is predicated upon some pretty serious, yet plausible, assumptions about how our universe works. To my knowledge, these assumptions have not themselves been explained using other principles and/or experimental verifications of some kind; for the kinetic equation, upon whom the theorem derives life, contains fundamental assumptions about how particles interact. That said, the H-theorem is a beautiful model of the interaction of particles, and we see a strong resemblance of it's behavior to the physically observable concept called Entropy. 
A: In thermodynamics, the early 19th century science about heat as a "macroscopic entity", the second law of thermodynamics was an axiom, a principle that couldn't be derived from anything deeper. Instead, physicists used it as a basic assumption to derive many other things about the thermal phenomena. The axiom was assumed to hold exactly.
In the late 19th century, people realized that thermal phenomena are due to the motion of atoms and the amount of chaos in that motion. Laws of thermodynamics could suddenly be derived from microscopic considerations. The second law of thermodynamics then holds "almost at all times", statistically – it doesn't hold strictly because the entropy may temporarily drop by a small amount. It's unlikely for entropy to drop by too much; the process' likelihood goes like $\exp(\Delta S/k_B)$, $\Delta S \lt 0$. So for macroscopic decreases of the entropy, you may prove that they're "virtually impossible".
The mathematical proof of the second law of thermodynamics within the axiomatic system of statistical physics is known as the Boltzmann's H-theorem or its variations of various kinds.
Yes, if you will simulate (let us assume you are talking about classical, deterministic physics) many atoms and their positions, you will see that they're evolving into the increasingly disordered states so that the entropy is increasing at almost all times (unless you extremely finely adjust the initial state – unless you maliciously calculate the very special initial state for which the entropy will happen to decrease, but these states are extremely rare and they don't differ from the majority in any other way than just by the fact that they happen to evolve into lower-entropy states).
A: 
My question is basically this. Is the second law of thermodynamics a fundamental, basic law of physics, or does it emerge from more fundamental laws?

It would be useful first to say what is the 2nd law and what it isn't.
2nd law: when system goes from equilibrium state 1 to equilibrium state 2 in any way and exchanges heat with reservoir at temperature $T_r$,
$$
S_2 \geq S_1 + \int_1^2\frac{d Q}{T_r}
$$
In special case there is no heat transferred, 
$$
S_2 \geq S_1.
$$
This law is valid for controlled macroscopic systems such as the working medium in a heat engine. Within this domain, it is a basic law.
2nd law does not say that the entropy of all systems or Universe has to increase in time. It speaks only of states of thermodynamic equilibrium.
There were and are attempts to derive 2nd law from microscopic theory, but there are always some additional assumptions about the probability. With these, it was proven that the above law will be obeyed in an actual process with probability very close to 1 (the greater the number of particles, the better). Since probabilistic ideas are involved, it cannot be said that the law is derived as unescapable consequence from the equations of motion.

Let's say I was to write a massive computer simulation of our universe. I model every single sub-atomic particle with all their known behaviours, the fundamental forces of nature as well as (for the sake of this argument) Newtonian mechanics. Now I press the "run" button on my program - will the second law of thermodynamics become "apparent" in this simulation, or would I need to code in special rules for it to work?

Most probably it will not be apparent, since it would hardly be possible to ascertain whether the system is in some kind of equilibrium state.
If you somehow extend the notion of entropy to complicated particle/field system in any microscopic state, then the question makes much more sense, but then it is also no longer about the entropy of the 2nd law, only about the new concept of entropy.
Then, you will need to start the simulation with some initial conditions (boundary conditions). If all the basic equations in the computer model are time-reversible (and the most basic equations of motion are), then for each initial condition that leads to increasing entropy there is an initial condition that leads to decreasing entropy.
To find such "weird" condition, let's think of a model that describes particles moving under influence of their gravitational forces. Just consider the trajectory that increases entropy, take its final point, reverse all the velocities and start the simulation again. The system will retrace its past states, so its entropy has to decrease.
One can get systematic increase of entropy only if the initial states are being chosen in a special way. We do not know whether the Universe started in such special state or not, or whether the entropy of the Universe, be it anything, increases or not. These and related questions of "heat death of the Universe" are entirely out of scope of the 2nd law of thermodynamics.
A: First we would start by stating what version of the second law. The classical thermodynamics version $\Delta S \ge 0$ for isolated systems is not fundamental. First it doesn't apply to open systems and has to be replaced by $\Delta_i S \ge 0$. Second, it refers to macroscopic systems that aren't too special (long-range correlations). Moreover, it can be derived from more fundamental expressions. For instance taking a local production of entropy $\sigma_S = \sum J_i X_i = J_Q\nabla(1/T) + J_N \nabla(\mu/T) + \cdots$ and integrating over the whole volume of the macroscopic system one obtains the classical expression $\Delta_i S \ge 0$.
Now if by second law you mean the modern microscopic version (The second law as a selection principle: The microscopic theory of dissipative processes in quantum systems), then it is not derivable from anything else.
About simulations. If you use "fundamental forces" and Newtonian mechanics you will get a simulation that could agree with our universe or not, because the laws of mechanics are compatible with heat spontaneously flowing from hot to cold and with flowing from cold to hot, when only one of those processes is observed in nature. Precisely that is the reason why thermodynamics was invented to deal with such observations and complement Newtonian mechanics.
To correctly simulate Universe (at least when relativity and quantum effects aren't important) you have to use dissipative particle dynamics. This is a standard procedure that uses Newtonian equations $ma = F$ with a total force given by $F= F_C + F_D + F_R$. The first term are conservative (and time reversible and deterministic) forces, the second are dissipative or frictional forces and the last are random (stochastic) forces. The explicit expressions for the dissipative and random forces are chosen to be compatible with the second law.
Note: Since Boltzmann H-theorem has been mentioned in other replies and comments, a pair of remarks are worth. First, the theorem is only valid for a special kind of diluted gases, whereas the second law is more general. Second, Boltzmann original demonstration of the theorem is incorrect. There are a huge literature on the hidden assumptions and explicit mistakes made by Boltzmann and why, contrary to his claims, he didn't derive the second law. Many modern re-derivations of the theorem repeat the old mistakes or make some new.
A: I see the second law of thermodymamics more as an empirical principle. In the history of our universe as we know it now, many times it did not appear to hold. 
If you simulate some air molecules in a box tracking their paths you will soon end with a more or less uniform distribution of particles in a situation of maximum disorder. However if you try to do the same starting from the quark-gluon plasma of the primordial universe, you'll need a way to break the second law in order to create articulate structures (from stars to DNA) from the initial disorder.
We still lack a lot of comprehension about these things.
A: The 'second law of thermodynamics' is a not a law of physics, it is just a statement about probabilities.  It is similar to the statement 'the probability of a fair coin coming up heads a million times in a row is very low'.
