  This paper is a study of the electromagnetic radiation at temperature $T$ in
a thin slab whose walls are made of a perfect conductor. The two large parallel
walls of area $A$ are apart by a distance $d\ll \sqrt{A}$. We take $T$, $A$,
and $d$ as thermodynamic parameters, obtaining the free energy from a procedure
that involves the integration over the slab of the ensemble average of the
stress-energy-momentum tensor calculated long ago by Brown and Maclay. Both
thermodynamic regimes $kTd/\hbar c\gg 1$ and $kTd/\hbar c\ll 1$ are fully
addressed. We show that certain thermodynamic quantities which are notoriously
ill defined (or trivial) in ordinary blackbody thermodynamics are now well
defined (or nontrivial) due to presence of boundary conditions at the walls of
the slab ("Casimir's effect"). The relationships among such quantities are
fully explored and it is speculated that they may be experimentally checked.
Stability is addressed, showing that electromagnetic radiation in the slab is
thermally stable; but mechanically unstable. We investigate thermodynamic
processes where temperature, internal energy, entropy and enthalpy are each
taken to be constant, revealing rather atypical behaviors. For example, in
sharp contrast with what one would expect from a gas, when $kTd/\hbar c\ll 1$,
"free expansion" gives place to "free contraction'' in accordance with the
second law of thermodynamics. As a check of consistency of the formulae we
remark that various Carnot cycles have been examined and verified that they
correctly lead to Carnot's efficiency.
