User talk:Love4boobies: Difference between revisions

From OSDev.wiki
Latest comment: 13 years ago by Fanael
Jump to navigation Jump to search
Content added Content deleted
No edit summary
No edit summary
Line 2: Line 2:


:You can. Use <stdint.h> and you get uint64_t et al. -- [[User:Solar|Solar]] 16:25, 10 March 2011 (UTC)
:You can. Use <stdint.h> and you get uint64_t et al. -- [[User:Solar|Solar]] 16:25, 10 March 2011 (UTC)

::You can't do that in ANSI C, nor you can in C++, so <stdint.h> is close to useless for anyone who can't or don't want to use C99 features. -- [[User:Fanael|Fanael]] 17:38, 10 March 2011 (UTC)


:Solar is correct and it's what I meant by that. As for serialization, it was also explained in the description. It is important to learn C before writing an OS in it. Structure fields may have gaps between them, they are not like arrays (e.g., because of alignment requirements or cache optimizations). --[[User:Love4boobies|Love4boobies]] 17:11, 10 March 2011 (UTC)
:Solar is correct and it's what I meant by that. As for serialization, it was also explained in the description. It is important to learn C before writing an OS in it. Structure fields may have gaps between them, they are not like arrays (e.g., because of alignment requirements or cache optimizations). --[[User:Love4boobies|Love4boobies]] 17:11, 10 March 2011 (UTC)

Revision as of 17:38, 10 March 2011

Why did you undo my edit to FADT? You said that it didn't use C types. But it uses the same types used in RSDT and RSDP. Moreover you can't use C types to describe a 64 bit type for example. It would be unsigned long long on x86, and unsigned long on x86_64, so a typedef like QWORD is justified IMO. And could you please explain the "serialization" problem? Alfaomega08

You can. Use <stdint.h> and you get uint64_t et al. -- Solar 16:25, 10 March 2011 (UTC)Reply[reply]
You can't do that in ANSI C, nor you can in C++, so <stdint.h> is close to useless for anyone who can't or don't want to use C99 features. -- Fanael 17:38, 10 March 2011 (UTC)Reply[reply]
Solar is correct and it's what I meant by that. As for serialization, it was also explained in the description. It is important to learn C before writing an OS in it. Structure fields may have gaps between them, they are not like arrays (e.g., because of alignment requirements or cache optimizations). --Love4boobies 17:11, 10 March 2011 (UTC)Reply[reply]
Do you mean I should put an __attribute__((packed)) at the end of the structure? If that's the problem, I skipped it because 1) it's not cross-platform 2) I think it is given for granted that any structure in os development should be packed. -- Alfaomega08 17:22, 10 March 2011 (UTC)Reply[reply]
No, that's not what I meant. Here are a couple of links to get you started: Serialization, required knowledge before starting an OS.
Well, I know what serialization is, and I'm quite sure to have the necessary skills to program an OS, however I still can't see how "Structure fields may have gaps between them" fits in the picture, as the packed attribute should remove all those gaps... -- Alfaomega08 17:33, 10 March 2011 (UTC)Reply[reply]