From 514b9973b6a4525a4ee30b757134da6f1abc4cab Mon Sep 17 00:00:00 2001 From: lr <1234@qq.com> Date: Fri, 17 May 2024 15:23:08 +0800 Subject: [PATCH] modify makefile eventually again --- Ubiquitous/XiZi_AIoT/services/app/test_net.c | 39 +++++++++++++++++++ .../services/fs/fs_server/include/block_io.h | 2 +- .../services/net/net_server/Makefile | 2 + .../XiZi_AIoT/services/net/net_server/lwip.mk | 4 +- .../XiZi_AIoT/services/tools/mkfs/mkfs.h | 2 +- 5 files changed, 45 insertions(+), 4 deletions(-) create mode 100644 Ubiquitous/XiZi_AIoT/services/app/test_net.c diff --git a/Ubiquitous/XiZi_AIoT/services/app/test_net.c b/Ubiquitous/XiZi_AIoT/services/app/test_net.c new file mode 100644 index 000000000..bf23bacf4 --- /dev/null +++ b/Ubiquitous/XiZi_AIoT/services/app/test_net.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2020 AIIT XUOS Lab + * XiUOS is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v2 for more details. + */ + +// test_net: Test the lwip network stack + +#include +#include +#include + +#include "libserial.h" +#include "lwip_service.h" +#include "usyscall.h" + +int main(int argc, char* argv[]) +{ + printf("lwip network stack test \n"); + + struct Session sess; + connect_session(&sess, "LWIPServer", 4096); + + char lwip_ipaddr[4] = { 192, 168, 130, 77 }; + char lwip_netmask[4] = { 255, 255, 254, 0 }; + char lwip_gwaddr[4] = { 192, 168, 130, 1 }; + LWIP_init(&sess, lwip_ipaddr, lwip_netmask, lwip_ipaddr); + + free_session(&session); + + exit(0); + return 0; +} \ No newline at end of file diff --git a/Ubiquitous/XiZi_AIoT/services/fs/fs_server/include/block_io.h b/Ubiquitous/XiZi_AIoT/services/fs/fs_server/include/block_io.h index 1bf3966bb..8fd07762b 100644 --- a/Ubiquitous/XiZi_AIoT/services/fs/fs_server/include/block_io.h +++ b/Ubiquitous/XiZi_AIoT/services/fs/fs_server/include/block_io.h @@ -18,7 +18,7 @@ // Block size #define BLOCK_SIZE 512 -#define NR_BIT_BLOCKS 4 +#define NR_BIT_BLOCKS 2 // bits size #define BITS 8 diff --git a/Ubiquitous/XiZi_AIoT/services/net/net_server/Makefile b/Ubiquitous/XiZi_AIoT/services/net/net_server/Makefile index 15b3bb4bc..24687b1bb 100644 --- a/Ubiquitous/XiZi_AIoT/services/net/net_server/Makefile +++ b/Ubiquitous/XiZi_AIoT/services/net/net_server/Makefile @@ -56,8 +56,10 @@ libipc = $(KERNEL_ROOT)/services/app/libipc.o lwip: COMPILER lwip_server.o | bin @${ld} ${user_ldflags} -e main -o $@ ${api} ${core} ${ipv4} ${netif} lwip_service.o lwip_server.o \ ${board_specs} ${libserial} ${printf} ${libmem} ${usyscall} ${arch_usyscall} ${session} ${libipc} + @${objdump} -S $@ > $@.asm @mv *.o bin @mv $@ $(KERNEL_ROOT)/services/app + @mv $@.asm $(KERNEL_ROOT)/services/app bin: @mkdir -p bin diff --git a/Ubiquitous/XiZi_AIoT/services/net/net_server/lwip.mk b/Ubiquitous/XiZi_AIoT/services/net/net_server/lwip.mk index f8852ad32..ef9a3891c 100644 --- a/Ubiquitous/XiZi_AIoT/services/net/net_server/lwip.mk +++ b/Ubiquitous/XiZi_AIoT/services/net/net_server/lwip.mk @@ -1,7 +1,7 @@ ifeq ($(BOARD), imx6q-sabrelite) toolchain ?= arm-none-eabi- -user_ldflags = --specs=nosys.specs -Wl,-Map=user.map,-cref -cflags = -std=c11 -march=armv7-a -mtune=cortex-a9 -nostdlib -ffreestanding -nodefaultlibs -mfloat-abi=soft -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie +user_ldflags = --specs=nosys.specs -Wl,-Map=user.map,-cref -N +cflags = -std=c11 -march=armv7-a -mtune=cortex-a9 -nostdlib -ffreestanding -nodefaultlibs -mfloat-abi=soft -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -Waddress -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie endif ifeq ($(BOARD), zynq7000-zc702) toolchain ?= arm-xilinx-eabi- diff --git a/Ubiquitous/XiZi_AIoT/services/tools/mkfs/mkfs.h b/Ubiquitous/XiZi_AIoT/services/tools/mkfs/mkfs.h index 17fa8adab..b7d299bb9 100755 --- a/Ubiquitous/XiZi_AIoT/services/tools/mkfs/mkfs.h +++ b/Ubiquitous/XiZi_AIoT/services/tools/mkfs/mkfs.h @@ -49,7 +49,7 @@ Modification: #define ROOT_INUM 1 // root inode number #define BLOCK_SIZE 512 // block size #define NR_BIT_PER_BYTE 8 -#define NR_BIT_BLOCKS 4 +#define NR_BIT_BLOCKS 2 #define nr_blocks_total (BLOCK_SIZE * NR_BIT_PER_BYTE * NR_BIT_BLOCKS) // total number of blocks (including used blocks and free blocks) #define nr_inodes 200 // total number of inodes