Skip to content

Commit

Permalink
Optimize kernel type to avoid confusion.
Browse files Browse the repository at this point in the history
  • Loading branch information
At-EC committed Apr 20, 2024
1 parent 15ae539 commit 1823b00
Show file tree
Hide file tree
Showing 57 changed files with 1,719 additions and 1,719 deletions.
2 changes: 1 addition & 1 deletion .github/remote_build/native_gcc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ target_compile_options(${PROJECT_NAME} PRIVATE
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-pointer-to-int-cast>
$<$<COMPILE_LANG_AND_ID:C,Clang>:-Wno-cast-align> )

target_link_libraries(${PROJECT_NAME} atos_kernal)
target_link_libraries(${PROJECT_NAME} atos_kernel)
8 changes: 4 additions & 4 deletions .github/remote_build/native_gcc/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
extern "C" {
#endif

/* Local defined the kernal thread stack and error postcode */
#define _PC_CMPT_FAILED PC_FAILED(PC_CMPT_KERNAL)
/* Local defined the kernel thread stack and error postcode */
#define _PC_CMPT_FAILED PC_FAILED(PC_CMPT_KERNEL)
#define SAMPLE_THREAD_STACK_SIZE (1024u)

ATOS_THREAD_DEFINE(sample_thread, SAMPLE_THREAD_STACK_SIZE, 5);

static os_thread_id_t g_sample_thread_id;

/*
* @brief The kernal sample entry function.
* @brief The kernel sample entry function.
**/
static void sample_entry_thread(void)
{
Expand All @@ -38,7 +38,7 @@ int main(void)
/* return _PC_CMPT_FAILED; */
}

/* At_RTOS kernal running starts */
/* At_RTOS kernel running starts */
AtOS.schedule_run();
D_ASSERT(0);

Expand Down
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
cmake_minimum_required(VERSION 3.20)

add_library(atos_kernal STATIC)
add_library(atos_kernel STATIC)

set(KERNAL_PATH ${CMAKE_CURRENT_LIST_DIR})
set(kernel_PATH ${CMAKE_CURRENT_LIST_DIR})

include_directories(${CMAKE_CURRENT_LIST_DIR})

target_sources(atos_kernal
target_sources(atos_kernel
PUBLIC
${CMAKE_CURRENT_LIST_DIR}/build_version.h
)

include(${CMAKE_CURRENT_LIST_DIR}/include/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/kernal/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/kernel/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/clock/CMakeLists.txt)
include(${CMAKE_CURRENT_LIST_DIR}/port/CMakeLists.txt)

if(NOT TARGET atos_config)
message(FATAL_ERROR " atos_config target not specified. Please specify a cmake target that defines the include path for atos_configuration.h\n")
endif()

target_link_libraries(atos_kernal atos_config)
target_link_libraries(atos_kernel atos_config)

36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Welcome PRs! If you are interested in contributing, Pls join us at [Discord](htt

| Version Name | Description |
| ------------- | ------------------------------------------------------------------------------------ |
| [![GitHub Release](https://img.shields.io/github/v/release/At-EC/At-RTOS)](./release-note.md) | Welcome to At-RTOS. This production version was released which supports a stable RTOS feature was implemented in the kernal system, Pls enjoy it (: |
| [![GitHub Release](https://img.shields.io/github/v/release/At-EC/At-RTOS)](./release-note.md) | Welcome to At-RTOS. This production version was released which supports a stable RTOS feature was implemented in the kernel system, Pls enjoy it (: |
| ![GitHub package.json version (branch)](https://img.shields.io/github/package-json/v/At-EC/At-RTOS/main) | The development version in the main branch was implemented which will support new features, but it probably has unknown issues. |

The release note is [here](https://github.com/At-EC/At-RTOS/releases).
Expand All @@ -31,7 +31,7 @@ At-RTOS is a type of Real-Time Operating System that focuses on adaptability and

It provides a range of features and capabilities such as thread scheduling, messages routing and interrupt handling, and more, to meet the requirements of embedded systems for real-time performance and reliability. It supports concurrent execution of multiple threads, enabling the management of multiple threads while ensuring synchronization and communication between them.

It's also offers extensive APIs(Application Programming Interfaces) that allow developers to configure the system, create threads, communicate betwwen threads, customize kernal clock, and more, with ease. Additionally At-RTOS supports various hardware platforms and compiilers specifically for the ARM Cortex M seiral architecture, offering good portability and scalability.
It's also offers extensive APIs(Application Programming Interfaces) that allow developers to configure the system, create threads, communicate betwwen threads, customize kernel clock, and more, with ease. Additionally At-RTOS supports various hardware platforms and compiilers specifically for the ARM Cortex M seiral architecture, offering good portability and scalability.

Overall, At-RTOS is powerful, flexible, and scalable real-time operating system suitable for the development and deployment of various embbedded systems. For more information on At-RTOS, it is recommended to refer to relevant technical documentation and sample codes.

Expand All @@ -52,7 +52,7 @@ And the keywords of the At-RTOS is shown as following lists.

## Cores

At-RTOS supports many architectures, and has covered the major architectures in current kernal system. It supports the following architectures, and it lists the chip that was verified.
At-RTOS supports many architectures, and has covered the major architectures in current kernel system. It supports the following architectures, and it lists the chip that was verified.

- [ ] `ARM Cortex-M` lists:
- [x] Cortex-M3: [GD32103C-START](https://www.gigadevice.com/product/mcu/arm-cortex-m3/gd32f103vct6)
Expand Down Expand Up @@ -93,30 +93,30 @@ At-RTOS
│ ├── port_iar.s
│ └── CMakeLists.txt
├── include
│ ├── kernal
│ ├── kernel
│ │ ├── at_rtos.h
│ │ └── *.h
│ ├── arch.h
│ ├── port.h
│ ├── clock_tick.h
│ └── CMakeLists.txt
├── kernal
│ ├── kernal.c
├── kernel
│ ├── kernel.c
│ ├── *.c
│ └── CMakeLists.txt
├── build_version.h
└── CMakeLists.txt
```

- **arch :** This folder provided the chip core architectures resource to support At-RTOS kernal feature.
- **clock :** It was implemented for At-RTOS kernal system tick to support system timers.
- **arch :** This folder provided the chip core architectures resource to support At-RTOS kernel feature.
- **clock :** It was implemented for At-RTOS kernel system tick to support system timers.
- **port :** It's used to support different compiler such as KEIL, IAR and GCC.
- **include :** It used to contain the At-RTOS kernal header files, Moreover it contained the portable arch, clock and port header files.
- **kernal :** This folder was implemented for the At-RTOS kernal files.
- **include :** It used to contain the At-RTOS kernel header files, Moreover it contained the portable arch, clock and port header files.
- **kernel :** This folder was implemented for the At-RTOS kernel files.

## Invoked resources

At-RTOS was designed specifically to take advantage of the powerful hardware features introduced with the ARM Cortex M architecture. The following HW resources were used in the At-RTOS kernal.
At-RTOS was designed specifically to take advantage of the powerful hardware features introduced with the ARM Cortex M architecture. The following HW resources were used in the At-RTOS kernel.

- Nested Vectored Interrupt Controller (NVIC)
- Service Call (SVC instruction)
Expand All @@ -143,16 +143,16 @@ At-RTOS ported a template At-RTOS configuration header file [atos_configuration.
#define ARCH_ARM_CORTEX_CM33

/**
* If you are use ARM Cortex M seiral architecture and use the system tick as the kernal timer.
* If you are use ARM Cortex M seiral architecture and use the system tick as the kernel timer.
* In most cases, PORTAL_SYSTEM_CORE_CLOCK_MHZ must be set to the frequency of the clock
* that drives the peripheral used to generate the kernels periodic tick interrupt.
* The default value is set to 120mhz.
*/
#define PORTAL_SYSTEM_CORE_CLOCK_MHZ (120u)
```
Your application will certainly need a different value so set the kernal component instance number correctly. This is very often, but not always. It's according to your system design.
The symbols in the configuration header file look like this `<kernal component>_INSTANCE_SUPPORTED_NUMBER`, and the kernal component is shown as following table:
Your application will certainly need a different value so set the kernel component instance number correctly. This is very often, but not always. It's according to your system design.
The symbols in the configuration header file look like this `<kernel component>_INSTANCE_SUPPORTED_NUMBER`, and the kernel component is shown as following table:
- THREAD
- SEMAPHORE
- EVENT
Expand All @@ -166,7 +166,7 @@ The more details you can see the descriptions in the template file [atos_configu
## User interface
The [at_rtos.h](./include/kernal/at_rtos.h) is an interface of At-RTOS kernal. You can check the interface usage in this file to perform it in your embedded controller system.
The [at_rtos.h](./include/kernel/at_rtos.h) is an interface of At-RTOS kernel. You can check the interface usage in this file to perform it in your embedded controller system.
The following sample codes illustrates how to create your first thread:
```c
Expand All @@ -193,7 +193,7 @@ int main(void)
printf("Thread %s init failed\n", your_thread_id.pName);
}
/* The At-RTOS kernal schedule starts to run. */
/* The At-RTOS kernel schedule starts to run. */
AtOS.schedule_run();
}
```
Expand All @@ -202,8 +202,8 @@ Note that: The following c/h files path must be included/contained in your proje

- `<root path>`\At-RTOS\
- `<root path>`\At-RTOS\include\
- `<root path>`\At-RTOS\include\kernal\
- `<root path>`\At-RTOS\kernal\<all>.c
- `<root path>`\At-RTOS\include\kernel\
- `<root path>`\At-RTOS\kernel\<all>.c
- `<root path>`\At-RTOS\clock\clock_systick.c
- `<root path>`\At-RTOS\port\port_common.c
- `<root path>`\At-RTOS\port\<your compiler>.c
Expand Down
6 changes: 3 additions & 3 deletions build_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
extern "C" {
#endif

#define ATOS_BUILD_TIME "2024-04-13,19:11"
#define ATOS_COMMIT_HEAD_ID "c07f1f47f92be3dfd394de63e781c9c24fee2510"
#define ATOS_BUILD_TIME "2024-04-20,15:06"
#define ATOS_COMMIT_HEAD_ID "15ae539784cbd1d3a83e2f08c4cf5c4d7e6a71e8"
#define ATOS_VERSION_MAJOR_NUMBER (1u)
#define ATOS_VERSION_MINOR_NUMBER (4u)
#define ATOS_VERSION_PATCH_NUMBER (3u)
#define ATOS_VERSION_PATCH_NUMBER (4u)

#define ATOS_VERSION_MAJOR_NUMBER_MASK (0x03FFu)
#define ATOS_VERSION_MAJOR_NUMBER_POS (22u)
Expand Down
8 changes: 4 additions & 4 deletions clock/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
include_directories(${KERNAL_PATH}/include)
include_directories(${KERNEL_PATH}/include)

target_sources(atos_kernal
target_sources(atos_kernel
PUBLIC
${KERNAL_PATH}/include/clock_tick.h
${KERNEL_PATH}/include/clock_tick.h

PRIVATE
${CMAKE_CURRENT_LIST_DIR}/clock_native_gcc.c
)

target_include_directories(atos_kernal
target_include_directories(atos_kernel
PRIVATE
${CMAKE_CURRENT_LIST_DIR}
)
Expand Down
22 changes: 11 additions & 11 deletions clock/clock_native_gcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static _clock_resource_t g_clock_resource = {0u};
*/
static b_t _clock_isWrap(void)
{
/* Nothing need to do for kernal cmake sample build. */
/* Nothing need to do for kernel cmake sample build. */
return FALSE;
}

Expand All @@ -55,12 +55,12 @@ static b_t _clock_isWrap(void)
*/
static u32_t _clock_elapsed(void)
{
/* Nothing need to do for kernal cmake sample build. */
/* Nothing need to do for kernel cmake sample build. */
return 0u;
}

/**
* @brief Report the elasped time for rtos kernal timer using, through the hook interface.
* @brief Report the elasped time for rtos kernel timer using, through the hook interface.
*
* @param Value of the elapsed time.
*/
Expand All @@ -76,17 +76,17 @@ static void _clock_time_elapsed_report(u32_t us)
*/
void _impl_clock_isr(void)
{
/* Nothing need to do for kernal cmake sample build. */
/* Nothing need to do for kernel cmake sample build. */
}

/**
* @brief The interface for kernal rtos set the next timeout.
* @brief The interface for kernel rtos set the next timeout.
*
* @param Value of the next timeout.
*/
void _impl_clock_time_interval_set(u32_t interval_us)
{
/* Nothing need to do for kernal cmake sample build. */
/* Nothing need to do for kernel cmake sample build. */
}

/**
Expand All @@ -96,7 +96,7 @@ void _impl_clock_time_interval_set(u32_t interval_us)
*/
u32_t _impl_clock_time_elapsed_get(void)
{
/* Nothing need to do for kernal cmake sample build. */
/* Nothing need to do for kernel cmake sample build. */
return 0u;
}

Expand All @@ -107,7 +107,7 @@ u32_t _impl_clock_time_elapsed_get(void)
*/
u32_t _impl_clock_time_get(void)
{
/* Nothing need to do for kernal cmake sample build. */
/* Nothing need to do for kernel cmake sample build. */
return 0u;
}

Expand All @@ -116,15 +116,15 @@ u32_t _impl_clock_time_get(void)
*/
void _impl_clock_time_enable(void)
{
/* Nothing need to do for kernal cmake sample build. */
/* Nothing need to do for kernel cmake sample build. */
}

/**
* @brief Disable the time clock.
*/
void _impl_clock_time_disable(void)
{
/* Nothing need to do for kernal cmake sample build. */
/* Nothing need to do for kernel cmake sample build. */
}

/**
Expand All @@ -134,7 +134,7 @@ void _impl_clock_time_init(time_report_handler_t pTime_function)
{
g_clock_resource.pCallFunc = pTime_function;

/* Nothing need to do for kernal cmake sample build. */
/* Nothing need to do for kernel cmake sample build. */
}

#ifdef __cplusplus
Expand Down
4 changes: 2 additions & 2 deletions clock/clock_systick.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static u32_t _clock_elapsed(void)
}

/**
* @brief Report the elasped time for rtos kernal timer using, through the hook interface.
* @brief Report the elasped time for rtos kernel timer using, through the hook interface.
*
* @param Value of the elapsed time.
*/
Expand Down Expand Up @@ -125,7 +125,7 @@ void _impl_clock_isr(void)
}

/**
* @brief The interface for kernal rtos set the next timeout.
* @brief The interface for kernel rtos set the next timeout.
*
* @param Value of the next timeout.
*/
Expand Down
48 changes: 24 additions & 24 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
add_library(kernal_include INTERFACE)
add_library(kernel_include INTERFACE)

include_directories(${KERNAL_PATH}/include)
include_directories(${KERNAL_PATH}/include/kernal)
include_directories(${KERNEL_PATH}/include)
include_directories(${KERNEL_PATH}/include/kernel)

target_sources(kernal_include
target_sources(kernel_include
PUBLIC
${KERNAL_PATH}/include/arch.h
${KERNEL_PATH}/include/arch.h

${KERNAL_PATH}/include/kernal/at_rtos.h
${KERNAL_PATH}/include/kernal/compiler.h
${KERNAL_PATH}/include/kernal/configuration.h
${KERNAL_PATH}/include/kernal/event.h
${KERNAL_PATH}/include/kernal/kernal.h
${KERNAL_PATH}/include/kernal/linker.h
${KERNAL_PATH}/include/kernal/list.h
${KERNAL_PATH}/include/kernal/kstruct.h
${KERNAL_PATH}/include/kernal/mutex.h
${KERNAL_PATH}/include/kernal/postcode.h
${KERNAL_PATH}/include/kernal/queue.h
${KERNAL_PATH}/include/kernal/semaphore.h
${KERNAL_PATH}/include/kernal/thread.h
${KERNAL_PATH}/include/kernal/timer.h
${KERNAL_PATH}/include/kernal/trace.h
${KERNAL_PATH}/include/kernal/typedef.h
${KERNAL_PATH}/include/kernal/ktype.h
${KERNAL_PATH}/include/kernal/kthread.h
${KERNAL_PATH}/include/kernal/pool.h
${KERNEL_PATH}/include/kernel/at_rtos.h
${KERNEL_PATH}/include/kernel/compiler.h
${KERNEL_PATH}/include/kernel/configuration.h
${KERNEL_PATH}/include/kernel/event.h
${KERNEL_PATH}/include/kernel/kernel.h
${KERNEL_PATH}/include/kernel/linker.h
${KERNEL_PATH}/include/kernel/list.h
${KERNEL_PATH}/include/kernel/kstruct.h
${KERNEL_PATH}/include/kernel/mutex.h
${KERNEL_PATH}/include/kernel/postcode.h
${KERNEL_PATH}/include/kernel/queue.h
${KERNEL_PATH}/include/kernel/semaphore.h
${KERNEL_PATH}/include/kernel/thread.h
${KERNEL_PATH}/include/kernel/timer.h
${KERNEL_PATH}/include/kernel/trace.h
${KERNEL_PATH}/include/kernel/typedef.h
${KERNEL_PATH}/include/kernel/ktype.h
${KERNEL_PATH}/include/kernel/kthread.h
${KERNEL_PATH}/include/kernel/pool.h
)
2 changes: 1 addition & 1 deletion include/clock_tick.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extern "C" {
typedef void (*time_report_handler_t)(u32_t);

/**
* The implement function lists for rtos kernal internal use.
* The implement function lists for rtos kernel internal use.
*/
void _impl_clock_isr(void);
void _impl_clock_time_interval_set(u32_t interval_us);
Expand Down
Loading

0 comments on commit 1823b00

Please sign in to comment.