The marriage record of Magnus Larsen and Kirstine Jonsdatter (erroneously written as Jensdatter) from 1822 states that Magnus was born in "Skognens prestegjeld", which belongs to Nord-Trøndelag.
See No 39:
SAT, Ministerialprotokoller, klokkerbøker og fødselsregistre - Sør-Trøndelag, 601/L0045: Ministerialbok nr. 601A13, 1821-1831, s. 272
Brukslenke for sidevisning:
https://www.digitalarkivet.no/kb20070921610550
I find the confirmation of Magnus Larsen Krogstad age 16 3/4 in Skogn on the 5th Sunday after Trinity (12 July) 1789, No 8:
SAT, Ministerialprotokoller, klokkerbøker og fødselsregistre - Nord-Trøndelag, 717/L0141: Ministerialbok nr. 717A01, 1747-1803, s. 427-428
Brukslenke for sidevisning:
https://www.digitalarkivet.no/kb20070925690110
however, here it is stated that he was born in Foldalen, which is located in today’s Hedmark, to the south of Trondheim.
This fits well with the baptism of Magnus, son of Lars Attendalen, on the 1st Sunday after Epiphany (9 January) 1774 in Foldalen, Lesja parish, born 2 Nov 1773
SAH, Lesja prestekontor, Ministerialbok nr. 2, 1732-1776, s. 666-667
Brukslenke for sidevisning:
https://www.digitalarkivet.no/kb20070603470438
There are ancient trade routes from Folldal to Trøndelag, so it is not surprising to find Magnus serving as an artillerist in Skogn and Trondheim. There is however no obvious link to the Porsgrunn area in the southern part of Norway
Kristine Jonsdatter is a very common name combination, which I do not think can be tied to a specific region in Norway, like Porsgrunn. In the marriage record, she is said to be from Stadsbygd, across the fjord from Trondheim. Furthermore, following the Y-chromosome line, her ancestry should not be of direct relevance.
The baptism of Magnus’ brother, Joen, on the 9th Sunday after Trinity 1775:
SAH, Lesja prestekontor, Ministerialbok nr. 2, 1732-1776, s. 694-695
Brukslenke for sidevisning:
https://www.digitalarkivet.no/kb20070603470452
confirms that their father is Lars
Erichsen Attendalen, and the mother is Beret Bersvendsd.
Hilsen
Matthias