Skip to content

Commit

Permalink
rpipico: rudimentary net support
Browse files Browse the repository at this point in the history
  • Loading branch information
veremenko-y committed Nov 3, 2024
1 parent bbea21e commit ecc8450
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Kernel/platform/platform-rpipico/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ add_executable(fuzix
../../tty.c
../../usermem.c
../../version.c
../../dev/net/net_native.c
../../syscall_net.c
../../network.c
)

target_link_libraries(fuzix
Expand Down
15 changes: 14 additions & 1 deletion Kernel/platform/platform-rpipico/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
#undef CONFIG_IDUMP
/* Enable to make ^A drop back into the monitor */
#undef CONFIG_MONITOR
/* Enable to support network stack */
#undef CONFIG_NET
#undef CONFIG_NET_NATIVE
/* Profil syscall support (not yet complete) */
#undef CONFIG_PROFIL
/* Multiple processes in memory at once */
Expand Down Expand Up @@ -68,7 +71,17 @@

#define UDATA_BLKS 3
#define UDATA_SIZE (UDATA_BLKS << BLKSHIFT)
#define USERMEM (160*1024)

#define TOTALMEM 160
#define NETMEM 0

#ifdef CONFIG_NET
#undef NETMEM
#define NETMEM 10
#endif

#define USERMEM ((TOTALMEM-NETMEM)*1024)

#define PROGSIZE (65536 - UDATA_SIZE)
extern uint8_t progbase[USERMEM];
#define udata (*(struct u_data*)progbase)
Expand Down
7 changes: 7 additions & 0 deletions Kernel/platform/platform-rpipico/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ static void timer_tick_cb(unsigned alarm)
irqrestore(irq);
}

#ifdef CONFIG_NET
extern void netdev_init(void);
#endif

void device_init(void)
{
/* Timer interrup must be initialized before blcok devices.
Expand All @@ -75,6 +79,9 @@ void device_init(void)
* cause a crash on startup... oddly. */
#ifdef CONFIG_PICO_FLASH
flash_dev_init();
#endif
#ifdef CONFIG_NET
netdev_init();
#endif
sd_rawinit();
devsd_init();
Expand Down

0 comments on commit ecc8450

Please sign in to comment.