{"id":13937830,"url":"https://github.com/ApolloAuto/apollo-kernel","last_synced_at":"2025-07-20T00:31:12.057Z","repository":{"id":22441087,"uuid":"95910564","full_name":"ApolloAuto/apollo-kernel","owner":"ApolloAuto","description":"Collections of Apollo Kernels","archived":false,"fork":false,"pushed_at":"2022-05-27T11:49:48.000Z","size":151479,"stargazers_count":409,"open_issues_count":4,"forks_count":289,"subscribers_count":109,"default_branch":"master","last_synced_at":"2025-06-26T13:46:31.356Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ApolloAuto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-30T17:36:09.000Z","updated_at":"2025-06-18T07:37:35.000Z","dependencies_parsed_at":"2022-07-26T03:02:11.516Z","dependency_job_id":null,"html_url":"https://github.com/ApolloAuto/apollo-kernel","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ApolloAuto/apollo-kernel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApolloAuto%2Fapollo-kernel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApolloAuto%2Fapollo-kernel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApolloAuto%2Fapollo-kernel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApolloAuto%2Fapollo-kernel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ApolloAuto","download_url":"https://codeload.github.com/ApolloAuto/apollo-kernel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ApolloAuto%2Fapollo-kernel/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266048494,"owners_count":23868738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-07T23:03:56.741Z","updated_at":"2025-07-20T00:31:11.355Z","avatar_url":"https://github.com/ApolloAuto.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# Apollo Kernel\n\nThe Apollo Kernel provides the necessary kernel level support to run Apollo software stack.\nIn the first release, we add the most popular solution, Linux Kernel, under the linux directory.\n\n## Linux Kernel\n\nApollo Linux Kernel is based on official [Linux Kernel 4.4.32](https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.4.32.tar.gz) with some modifications.\n\n### What is the difference\n\n  * Realtime patch (https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO)\n  * Latest e1000e intel ethernet driver\n  * Bugfix for Nvidia driver under realtime patch\n  * Double free in the inet_csk_clone_lock function patch (https://bugzilla.redhat.com/show_bug.cgi?id=1450972)\n  * Other cve security patches\n\n[Kernel config files](https://github.com/ApolloAuto/apollo-kernel/tree/master/linux/configs) are modified for Apollo based on Ubuntu's config-4.4.0-X-generic.\n\nThe Apollo team would like to thank everybody in the open source community. The GitHub apollo-kernel/linux is based on Linux. Currently, Apollo team maintains this repository. In near future, we’ll send patches back to Linux community.\n\n### Add ESD CAN Support\n\nYou will need to add ESD CAN driver to run Apollo software using ESD CAN card. Please refer to linux/ESDCAN-README.md for more information.\n\n### How to Download the Release Package\n\nDownload the release packages from the release section on github:\n\n```\nhttps://github.com/ApolloAuto/apollo-kernel/releases\n```\n\n### How to Install\n\nAfter having the release package downloaded:\n\n```\ntar zxvf linux-4.4.32-apollo-1.0.0.tar.gz\ncd install\nsudo ./install_kernel.sh\n```\n\n### How to Build\n\n\nIf you would like cutomize and build your own kernel, simply run:\n\n```\n./build.sh\n```\n\nYou can find the installation kernel package under directory:\n\n```\n./install/rt\n```\n\n### Realtime \"Hello World\" Example\n(https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO#A_Realtime_.22Hello_World.22_Example)\n\n* Setting a real time scheduling policy and priority\n* Locking memory so that page faults caused by virtual memory will not undermine deterministic behavior\n* Pre-faulting the stack, so that a future stack fault will not undermine deterministic behavior\n\nThe following example contains some very basic example code of a real time application with realtime preemption patch. Compile as follows:\n```\ngcc -o test_rt test_rt.c -lrt\n```\n\nSource code as below:\n```\n#include \u003cstdlib.h\u003e\n#include \u003cstdio.h\u003e\n#include \u003ctime.h\u003e\n#include \u003csched.h\u003e\n#include \u003csys/mman.h\u003e\n#include \u003cstring.h\u003e\n\n#define MY_PRIORITY (49) /* we use 49 as the PRREMPT_RT use 50\n                            as the priority of kernel tasklets\n                            and interrupt handler by default */\n\n#define MAX_SAFE_STACK (8*1024) /* The maximum stack size which is\n                                   guaranteed safe to access without\n                                   faulting */\n\n#define NSEC_PER_SEC    (1000000000) /* The number of nsecs per sec. */\n\nvoid stack_prefault(void) {\n\n        unsigned char dummy[MAX_SAFE_STACK];\n\n        memset(dummy, 0, MAX_SAFE_STACK);\n        return;\n}\n\nint main(int argc, char* argv[])\n{\n        struct timespec t;\n        struct sched_param param;\n        int interval = 50000; /* 50us*/\n\n        /* Declare ourself as a real time task */\n\n        param.sched_priority = MY_PRIORITY;\n        if(sched_setscheduler(0, SCHED_FIFO, \u0026param) == -1) {\n                perror(\"sched_setscheduler failed\");\n                exit(-1);\n        }\n\n        /* Lock memory */\n\n        if(mlockall(MCL_CURRENT|MCL_FUTURE) == -1) {\n                perror(\"mlockall failed\");\n                exit(-2);\n        }\n\n        /* Pre-fault our stack */\n\n        stack_prefault();\n\n        clock_gettime(CLOCK_MONOTONIC ,\u0026t);\n        /* start after one second */\n        t.tv_sec++;\n\n        while(1) {\n                /* wait until next shot */\n                clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, \u0026t, NULL);\n\n                /* do the stuff */\n\n                /* calculate next shot */\n                t.tv_nsec += interval;\n\n                while (t.tv_nsec \u003e= NSEC_PER_SEC) {\n                       t.tv_nsec -= NSEC_PER_SEC;\n                        t.tv_sec++;\n                }\n   }\n}\n```\n\n### Disclaimer\nThe patched Linux kernel is specifically for running Apollo software stack on an Apollo 1.0 Reference Hardware Platform (see [*Apollo 1.0 Hardware and System Installation Guide*](https://github.com/ApolloAuto/apollo/blob/master/docs/quickstart/apollo_1_0_hardware_system_installation_guide.md) for more information). It is not recommended for any other purposes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FApolloAuto%2Fapollo-kernel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FApolloAuto%2Fapollo-kernel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FApolloAuto%2Fapollo-kernel/lists"}