In the last few decades, a lot of data have been collected on the primate visual system, enough to guide the building of a mechanistic model, at least of input layers. There is also ample evidence that knowledge of the visual cortex will offer a window into other cortical areas, about which much less is known. In these two lectures I would like to report on some modeling work. After a little bit of neurobiological background and an overview of the model, I will select a few topics aimed at showcasing the flavor of different aspects of mathematical modeling and how (simple) analytical thinking can shed light on cortical mechanisms. I will discuss dynamics within local circuits, nonequilibrium steady states across cortical surfaces, and hypotheses on the origin of some cortical capabilities.