forked from xuos/xiuos
				
			modify makefile eventually again
This commit is contained in:
		
							parent
							
								
									18537fc922
								
							
						
					
					
						commit
						514b9973b6
					
				| 
						 | 
					@ -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 <assert.h>
 | 
				
			||||||
 | 
					#include <stdbool.h>
 | 
				
			||||||
 | 
					#include <string.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#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;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Block size
 | 
					// Block size
 | 
				
			||||||
#define BLOCK_SIZE 512
 | 
					#define BLOCK_SIZE 512
 | 
				
			||||||
#define NR_BIT_BLOCKS 4
 | 
					#define NR_BIT_BLOCKS 2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// bits size
 | 
					// bits size
 | 
				
			||||||
#define BITS 8
 | 
					#define BITS 8
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -56,8 +56,10 @@ libipc = $(KERNEL_ROOT)/services/app/libipc.o
 | 
				
			||||||
lwip: COMPILER lwip_server.o | bin
 | 
					lwip: COMPILER lwip_server.o | bin
 | 
				
			||||||
	@${ld} ${user_ldflags} -e main -o $@ ${api} ${core} ${ipv4} ${netif} lwip_service.o lwip_server.o \
 | 
						@${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}
 | 
							${board_specs} ${libserial} ${printf} ${libmem} ${usyscall} ${arch_usyscall} ${session} ${libipc}
 | 
				
			||||||
 | 
						@${objdump} -S $@ > $@.asm
 | 
				
			||||||
	@mv *.o bin
 | 
						@mv *.o bin
 | 
				
			||||||
	@mv $@ $(KERNEL_ROOT)/services/app
 | 
						@mv $@ $(KERNEL_ROOT)/services/app
 | 
				
			||||||
 | 
						@mv $@.asm $(KERNEL_ROOT)/services/app
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bin:
 | 
					bin:
 | 
				
			||||||
	@mkdir -p bin
 | 
						@mkdir -p bin
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
ifeq ($(BOARD), imx6q-sabrelite)
 | 
					ifeq ($(BOARD), imx6q-sabrelite)
 | 
				
			||||||
toolchain ?= arm-none-eabi-
 | 
					toolchain ?= arm-none-eabi-
 | 
				
			||||||
user_ldflags = --specs=nosys.specs -Wl,-Map=user.map,-cref
 | 
					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 -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie
 | 
					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
 | 
					endif
 | 
				
			||||||
ifeq ($(BOARD), zynq7000-zc702)
 | 
					ifeq ($(BOARD), zynq7000-zc702)
 | 
				
			||||||
toolchain ?= arm-xilinx-eabi-
 | 
					toolchain ?= arm-xilinx-eabi-
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -49,7 +49,7 @@ Modification:
 | 
				
			||||||
#define ROOT_INUM 1 // root inode number
 | 
					#define ROOT_INUM 1 // root inode number
 | 
				
			||||||
#define BLOCK_SIZE 512 // block size
 | 
					#define BLOCK_SIZE 512 // block size
 | 
				
			||||||
#define NR_BIT_PER_BYTE 8
 | 
					#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_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
 | 
					#define nr_inodes 200 // total number of inodes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue