Deoxyribonucleic acid (DNA) is a long and flexible biopolymer that contains genetic information. Building upon the discovery of the iconic double helix over 50 years ago, subsequent studies have emphasized how its biological function is related to the mechanical properties of the molecule. A remarkable system which highlights the role of DNA bending and twisting is the packing and ejection of DNA into and from viral capsids. A recent 3D reconstruction of bacteriophage reveals a novel toroidal structure of highly bent/twisted DNA contained in a small cavity below the viral capsid. Here, we extend an elastic rod model for DNA to enable simulation of the toroid as it is compacted and subsequently ejected from a small volume. We compute biologically-relevant forces required to form the toroid and predict ejection times of several nanoseconds.