T
T
Type Programmer2020-02-11 19:53:15
C++ / C#
Type Programmer, 2020-02-11 19:53:15

How to build a binary with an assembler entry point for a C kernel?

Tell me ways, perhaps links, names, how you can transfer control to code written in C.
It’s just that earlier everything that I wrote was in one file and in one language, but here I don’t understand how to combine everything so that it works ..)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iBott, 2020-02-11
@MegaCraZy6

Here's a tutorial on how to call code written in C from assembler:
https://wiki.osdev.org/Bare_Bones_with_NASM
Full guide:
https://wiki.osdev.org/Bare_Bones
You need to define the function you want to call, as extern (if you use NASM) in assembly code (as far as I understand, you have this function in another object file compiled from C code). Then just call it. (Just don't forget to arrange everything correctly.)
It seems to be what you need.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question