Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

simple_socket_server

I am learning NiosII,I think the source code of simple_socket_server is a good start for me. when I study it,I find a problem:

the system init function seem's as alt_sys_init() which in alt_sys_init.c. but Ican't find at where it was call. anybody help me please!

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    ZZS, alt_sys_init is called from alt_main()

    this in turn is called from ctr0.s, which is the initial bootloader.

    after returning from alt_sys_init(), alt_main() calls main(), and your application starts.

    fro the ide, do a search->file alt_main.c to locate the system file alt_main.

    if you want to be really clever, you can put a copy of alt_sys_init and alt_main files in your local project directory, alter it to your needs, and it will override the system file found in the HAL. in this way you can customise the devices initialised at boot time

    ashone
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    ashone

    thanks very mach,I'm understand it. I will continue my study. thanks again