If I got it right, TCP and IP packets are created normally by software running in the kernel. So when I as a user open up a socket of type TCP/IP and send a message, the kernel takes care of all those protocols details such as splitting the message to packets, prepending TCP and IP headers, etc.
Now, if I understand correctly, a layer 2 frame are technology specific - so a frame will look differently if you use Ethernet, WiFi, or any other layer 2 technology. so my question is: does this mean that the layer 2 protocol headers are generated and handled by the NIC device driver?